home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / libs / libelf-0.5 / libelf-0
Tape Archive  |  1995-10-23  |  270.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: Tape Archive (archive/tar).

You can browse this item here: libelf-0

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Tape Archive (archive/tar) magic Supported
100% file POSIX tar archive (GNU) default
99% file POSIX tar archive (GNU), directory libelf-0.5.2/, mode 40755 , uid 144 , gid 24 , size 0 , seconds 6042572312, user michael, group staff default
98% file data default
62% TrID TAR - Tape ARchive (GNU) default
37% TrID TAR - Tape ARchive (directory) default
100% siegfried x-fmt/265 Tape Archive Format default
100% lsar Tar default
100% gt2 TAR Archiv gefunden (Auflistung ist deaktiviert) default
100% disktype GNU tar archive default
100% detectItEasy Archive: tar default
100% binwalkID POSIX tar archive (GNU), owner user name: ".5.2/" default
100% xdgMime application/x-tar default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 6c 69 62 65 6c 66 2d 30 | 2e 35 2e 32 2f 00 00 00 |libelf-0|.5.2/...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 20 34 30 37 | 35 35 20 00 20 20 20 31 |.... 407|55 . 1|
|00000070| 34 34 20 00 20 20 20 20 | 32 34 20 00 20 20 20 20 |44 . |24 . |
|00000080| 20 20 20 20 20 20 30 20 | 20 36 30 34 32 35 37 32 | 0 | 6042572|
|00000090| 33 31 32 20 20 31 31 35 | 37 34 00 20 35 00 00 00 |312 115|74. 5...|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 75 73 74 61 72 20 20 | 00 6d 69 63 68 61 65 6c |.ustar |.michael|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 73 74 61 66 66 00 00 |........|.staff..|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 6c 69 62 65 6c 66 2d 30 | 2e 35 2e 32 2f 62 65 67 |libelf-0|.5.2/beg|
|00000210| 69 6e 2e 63 00 00 00 00 | 00 00 00 00 00 00 00 00 |in.c....|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 20 31 |....1006|44 . 1|
|00000270| 34 34 20 00 20 20 20 20 | 32 34 20 00 20 20 20 20 |44 . |24 . |
|00000280| 20 20 31 37 30 37 36 20 | 20 36 30 34 31 35 31 33 | 17076 | 6041513|
|00000290| 37 35 37 20 20 31 33 31 | 36 33 00 20 30 00 00 00 |757 131|63. 0...|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 75 73 74 61 72 20 20 | 00 6d 69 63 68 61 65 6c |.ustar |.michael|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 73 74 61 66 66 00 00 |........|.staff..|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 2f 2a 0a 62 65 67 69 6e | 2e 63 20 2d 20 69 6d 70 |/*.begin|.c - imp|
|00000410| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 20 6f 66 20 74 |lementat|ion of t|
|00000420| 68 65 20 65 6c 66 5f 62 | 65 67 69 6e 28 33 29 20 |he elf_b|egin(3) |
|00000430| 66 75 6e 63 74 69 6f 6e | 2e 0a 43 6f 70 79 72 69 |function|..Copyri|
|00000440| 67 68 74 20 28 43 29 20 | 31 39 39 35 20 4d 69 63 |ght (C) |1995 Mic|
|00000450| 68 61 65 6c 20 52 69 65 | 70 65 20 3c 72 69 65 70 |hael Rie|pe <riep|
|00000460| 65 40 69 66 77 73 6e 34 | 2e 69 66 77 2e 75 6e 69 |e@ifwsn4|.ifw.uni|
|00000470| 2d 68 61 6e 6e 6f 76 65 | 72 2e 64 65 3e 0a 0a 54 |-hannove|r.de>..T|
|00000480| 68 69 73 20 6c 69 62 72 | 61 72 79 20 69 73 20 66 |his libr|ary is f|
|00000490| 72 65 65 20 73 6f 66 74 | 77 61 72 65 3b 20 79 6f |ree soft|ware; yo|
|000004a0| 75 20 63 61 6e 20 72 65 | 64 69 73 74 72 69 62 75 |u can re|distribu|
|000004b0| 74 65 20 69 74 20 61 6e | 64 2f 6f 72 0a 6d 6f 64 |te it an|d/or.mod|
|000004c0| 69 66 79 20 69 74 20 75 | 6e 64 65 72 20 74 68 65 |ify it u|nder the|
|000004d0| 20 74 65 72 6d 73 20 6f | 66 20 74 68 65 20 47 4e | terms o|f the GN|
|000004e0| 55 20 4c 69 62 72 61 72 | 79 20 47 65 6e 65 72 61 |U Librar|y Genera|
|000004f0| 6c 20 50 75 62 6c 69 63 | 0a 4c 69 63 65 6e 73 65 |l Public|.License|
|00000500| 20 61 73 20 70 75 62 6c | 69 73 68 65 64 20 62 79 | as publ|ished by|
|00000510| 20 74 68 65 20 46 72 65 | 65 20 53 6f 66 74 77 61 | the Fre|e Softwa|
|00000520| 72 65 20 46 6f 75 6e 64 | 61 74 69 6f 6e 3b 20 65 |re Found|ation; e|
|00000530| 69 74 68 65 72 0a 76 65 | 72 73 69 6f 6e 20 32 20 |ither.ve|rsion 2 |
|00000540| 6f 66 20 74 68 65 20 4c | 69 63 65 6e 73 65 2c 20 |of the L|icense, |
|00000550| 6f 72 20 28 61 74 20 79 | 6f 75 72 20 6f 70 74 69 |or (at y|our opti|
|00000560| 6f 6e 29 20 61 6e 79 20 | 6c 61 74 65 72 20 76 65 |on) any |later ve|
|00000570| 72 73 69 6f 6e 2e 0a 0a | 54 68 69 73 20 6c 69 62 |rsion...|This lib|
|00000580| 72 61 72 79 20 69 73 20 | 64 69 73 74 72 69 62 75 |rary is |distribu|
|00000590| 74 65 64 20 69 6e 20 74 | 68 65 20 68 6f 70 65 20 |ted in t|he hope |
|000005a0| 74 68 61 74 20 69 74 20 | 77 69 6c 6c 20 62 65 20 |that it |will be |
|000005b0| 75 73 65 66 75 6c 2c 0a | 62 75 74 20 57 49 54 48 |useful,.|but WITH|
|000005c0| 4f 55 54 20 41 4e 59 20 | 57 41 52 52 41 4e 54 59 |OUT ANY |WARRANTY|
|000005d0| 3b 20 77 69 74 68 6f 75 | 74 20 65 76 65 6e 20 74 |; withou|t even t|
|000005e0| 68 65 20 69 6d 70 6c 69 | 65 64 20 77 61 72 72 61 |he impli|ed warra|
|000005f0| 6e 74 79 20 6f 66 0a 4d | 45 52 43 48 41 4e 54 41 |nty of.M|ERCHANTA|
|00000600| 42 49 4c 49 54 59 20 6f | 72 20 46 49 54 4e 45 53 |BILITY o|r FITNES|
|00000610| 53 20 46 4f 52 20 41 20 | 50 41 52 54 49 43 55 4c |S FOR A |PARTICUL|
|00000620| 41 52 20 50 55 52 50 4f | 53 45 2e 20 20 53 65 65 |AR PURPO|SE. See|
|00000630| 20 74 68 65 20 47 4e 55 | 0a 4c 69 62 72 61 72 79 | the GNU|.Library|
|00000640| 20 47 65 6e 65 72 61 6c | 20 50 75 62 6c 69 63 20 | General| Public |
|00000650| 4c 69 63 65 6e 73 65 20 | 66 6f 72 20 6d 6f 72 65 |License |for more|
|00000660| 20 64 65 74 61 69 6c 73 | 2e 0a 0a 59 6f 75 20 73 | details|...You s|
|00000670| 68 6f 75 6c 64 20 68 61 | 76 65 20 72 65 63 65 69 |hould ha|ve recei|
|00000680| 76 65 64 20 61 20 63 6f | 70 79 20 6f 66 20 74 68 |ved a co|py of th|
|00000690| 65 20 47 4e 55 20 4c 69 | 62 72 61 72 79 20 47 65 |e GNU Li|brary Ge|
|000006a0| 6e 65 72 61 6c 20 50 75 | 62 6c 69 63 0a 4c 69 63 |neral Pu|blic.Lic|
|000006b0| 65 6e 73 65 20 61 6c 6f | 6e 67 20 77 69 74 68 20 |ense alo|ng with |
|000006c0| 74 68 69 73 20 6c 69 62 | 72 61 72 79 3b 20 69 66 |this lib|rary; if|
|000006d0| 20 6e 6f 74 2c 20 77 72 | 69 74 65 20 74 6f 20 74 | not, wr|ite to t|
|000006e0| 68 65 20 46 72 65 65 20 | 53 6f 66 74 77 61 72 65 |he Free |Software|
|000006f0| 0a 46 6f 75 6e 64 61 74 | 69 6f 6e 2c 20 49 6e 63 |.Foundat|ion, Inc|
|00000700| 2e 2c 20 35 39 20 54 65 | 6d 70 6c 65 20 50 6c 61 |., 59 Te|mple Pla|
|00000710| 63 65 20 2d 20 53 75 69 | 74 65 20 33 33 30 2c 20 |ce - Sui|te 330, |
|00000720| 42 6f 73 74 6f 6e 2c 20 | 4d 41 20 30 32 31 31 31 |Boston, |MA 02111|
|00000730| 2d 31 33 30 37 2c 20 55 | 53 41 2e 0a 2a 2f 0a 0a |-1307, U|SA..*/..|
|00000740| 23 69 6e 63 6c 75 64 65 | 20 3c 70 72 69 76 61 74 |#include| <privat|
|00000750| 65 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 20 3c 61 |e.h>.#in|clude <a|
|00000760| 72 2e 68 3e 0a 0a 73 74 | 61 74 69 63 20 63 6f 6e |r.h>..st|atic con|
|00000770| 73 74 20 45 6c 66 20 5f | 65 6c 66 5f 69 6e 69 74 |st Elf _|elf_init|
|00000780| 20 3d 20 49 4e 49 54 5f | 45 4c 46 3b 0a 73 74 61 | = INIT_|ELF;.sta|
|00000790| 74 69 63 20 63 6f 6e 73 | 74 20 63 68 61 72 20 66 |tic cons|t char f|
|000007a0| 6d 61 67 5b 5d 20 3d 20 | 41 52 46 4d 41 47 3b 0a |mag[] = |ARFMAG;.|
|000007b0| 0a 73 74 61 74 69 63 20 | 75 6e 73 69 67 6e 65 64 |.static |unsigned|
|000007c0| 20 6c 6f 6e 67 0a 67 65 | 74 6e 75 6d 28 63 6f 6e | long.ge|tnum(con|
|000007d0| 73 74 20 63 68 61 72 20 | 2a 73 74 72 2c 20 73 69 |st char |*str, si|
|000007e0| 7a 65 5f 74 20 6c 65 6e | 2c 20 69 6e 74 20 62 61 |ze_t len|, int ba|
|000007f0| 73 65 2c 20 69 6e 74 20 | 2a 65 72 72 29 20 7b 0a |se, int |*err) {.|
|00000800| 20 20 20 20 75 6e 73 69 | 67 6e 65 64 20 6c 6f 6e | unsi|gned lon|
|00000810| 67 20 72 65 73 75 6c 74 | 20 3d 20 30 3b 0a 0a 20 |g result| = 0;.. |
|00000820| 20 20 20 77 68 69 6c 65 | 20 28 6c 65 6e 20 26 26 | while| (len &&|
|00000830| 20 2a 73 74 72 20 3d 3d | 20 27 20 27 29 20 7b 0a | *str ==| ' ') {.|
|00000840| 09 73 74 72 2b 2b 3b 20 | 6c 65 6e 2d 2d 3b 0a 20 |.str++; |len--;. |
|00000850| 20 20 20 7d 0a 20 20 20 | 20 77 68 69 6c 65 20 28 | }. | while (|
|00000860| 6c 65 6e 20 26 26 20 2a | 73 74 72 20 3e 3d 20 27 |len && *|str >= '|
|00000870| 30 27 20 26 26 20 28 2a | 73 74 72 20 2d 20 27 30 |0' && (*|str - '0|
|00000880| 27 29 20 3c 20 62 61 73 | 65 29 20 7b 0a 09 72 65 |') < bas|e) {..re|
|00000890| 73 75 6c 74 20 3d 20 62 | 61 73 65 20 2a 20 72 65 |sult = b|ase * re|
|000008a0| 73 75 6c 74 20 2b 20 2a | 73 74 72 2b 2b 20 2d 20 |sult + *|str++ - |
|000008b0| 27 30 27 3b 20 6c 65 6e | 2d 2d 3b 0a 20 20 20 20 |'0'; len|--;. |
|000008c0| 7d 0a 20 20 20 20 77 68 | 69 6c 65 20 28 6c 65 6e |}. wh|ile (len|
|000008d0| 20 26 26 20 2a 73 74 72 | 20 3d 3d 20 27 20 27 29 | && *str| == ' ')|
|000008e0| 20 7b 0a 09 73 74 72 2b | 2b 3b 20 6c 65 6e 2d 2d | {..str+|+; len--|
|000008f0| 3b 0a 20 20 20 20 7d 0a | 20 20 20 20 69 66 20 28 |;. }.| if (|
|00000900| 6c 65 6e 29 20 7b 0a 09 | 2a 65 72 72 20 3d 20 6c |len) {..|*err = l|
|00000910| 65 6e 3b 0a 20 20 20 20 | 7d 0a 20 20 20 20 72 65 |en;. |}. re|
|00000920| 74 75 72 6e 20 72 65 73 | 75 6c 74 3b 0a 7d 0a 0a |turn res|ult;.}..|
|00000930| 73 74 61 74 69 63 20 76 | 6f 69 64 0a 5f 65 6c 66 |static v|oid._elf|
|00000940| 5f 69 6e 69 74 5f 61 72 | 28 45 6c 66 20 2a 65 6c |_init_ar|(Elf *el|
|00000950| 66 29 20 7b 0a 20 20 20 | 20 73 74 72 75 63 74 20 |f) {. | struct |
|00000960| 61 72 5f 68 64 72 20 2a | 68 64 72 3b 0a 20 20 20 |ar_hdr *|hdr;. |
|00000970| 20 73 69 7a 65 5f 74 20 | 6f 66 66 73 65 74 3b 0a | size_t |offset;.|
|00000980| 20 20 20 20 73 69 7a 65 | 5f 74 20 73 69 7a 65 3b | size|_t size;|
|00000990| 0a 20 20 20 20 69 6e 74 | 20 65 72 72 20 3d 20 30 |. int| err = 0|
|000009a0| 3b 0a 0a 20 20 20 20 65 | 6c 66 2d 3e 65 5f 6b 69 |;.. e|lf->e_ki|
|000009b0| 6e 64 20 3d 20 45 4c 46 | 5f 4b 5f 41 52 3b 0a 20 |nd = ELF|_K_AR;. |
|000009c0| 20 20 20 65 6c 66 2d 3e | 65 5f 69 64 6c 65 6e 20 | elf->|e_idlen |
|000009d0| 3d 20 53 41 52 4d 41 47 | 3b 0a 20 20 20 20 65 6c |= SARMAG|;. el|
|000009e0| 66 2d 3e 65 5f 6f 66 66 | 20 3d 20 53 41 52 4d 41 |f->e_off| = SARMA|
|000009f0| 47 3b 0a 20 20 20 20 65 | 6c 66 2d 3e 65 5f 63 6f |G;. e|lf->e_co|
|00000a00| 6f 6b 65 64 20 3d 20 31 | 3b 09 20 20 20 20 2f 2a |oked = 1|;. /*|
|00000a10| 20 64 6f 20 6e 6f 74 20 | 66 72 65 65 7a 65 20 61 | do not |freeze a|
|00000a20| 72 63 68 69 76 65 73 21 | 20 2a 2f 0a 0a 20 20 20 |rchives!| */.. |
|00000a30| 20 2f 2a 20 70 72 6f 63 | 65 73 73 20 73 70 65 63 | /* proc|ess spec|
|00000a40| 69 61 6c 20 6d 65 6d 62 | 65 72 73 20 2a 2f 0a 20 |ial memb|ers */. |
|00000a50| 20 20 20 6f 66 66 73 65 | 74 20 3d 20 53 41 52 4d | offse|t = SARM|
|00000a60| 41 47 3b 0a 20 20 20 20 | 77 68 69 6c 65 20 28 21 |AG;. |while (!|
|00000a70| 65 6c 66 2d 3e 65 5f 73 | 74 72 74 61 62 20 26 26 |elf->e_s|trtab &&|
|00000a80| 20 6f 66 66 73 65 74 20 | 2b 20 73 69 7a 65 6f 66 | offset |+ sizeof|
|00000a90| 28 2a 68 64 72 29 20 3c | 3d 20 65 6c 66 2d 3e 65 |(*hdr) <|= elf->e|
|00000aa0| 5f 73 69 7a 65 29 20 7b | 0a 09 68 64 72 20 3d 20 |_size) {|..hdr = |
|00000ab0| 28 73 74 72 75 63 74 20 | 61 72 5f 68 64 72 2a 29 |(struct |ar_hdr*)|
|00000ac0| 28 65 6c 66 2d 3e 65 5f | 64 61 74 61 20 2b 20 6f |(elf->e_|data + o|
|00000ad0| 66 66 73 65 74 29 3b 0a | 09 69 66 20 28 6d 65 6d |ffset);.|.if (mem|
|00000ae0| 63 6d 70 28 68 64 72 2d | 3e 61 72 5f 66 6d 61 67 |cmp(hdr-|>ar_fmag|
|00000af0| 2c 20 66 6d 61 67 2c 20 | 73 69 7a 65 6f 66 28 66 |, fmag, |sizeof(f|
|00000b00| 6d 61 67 29 20 2d 20 31 | 29 29 20 7b 0a 09 20 20 |mag) - 1|)) {.. |
|00000b10| 20 20 62 72 65 61 6b 3b | 0a 09 7d 0a 09 69 66 20 | break;|..}..if |
|00000b20| 28 68 64 72 2d 3e 61 72 | 5f 6e 61 6d 65 5b 30 5d |(hdr->ar|_name[0]|
|00000b30| 20 21 3d 20 27 2f 27 29 | 20 7b 0a 09 20 20 20 20 | != '/')| {.. |
|00000b40| 62 72 65 61 6b 3b 0a 09 | 7d 0a 09 73 69 7a 65 20 |break;..|}..size |
|00000b50| 3d 20 67 65 74 6e 75 6d | 28 68 64 72 2d 3e 61 72 |= getnum|(hdr->ar|
|00000b60| 5f 73 69 7a 65 2c 20 73 | 69 7a 65 6f 66 28 68 64 |_size, s|izeof(hd|
|00000b70| 72 2d 3e 61 72 5f 73 69 | 7a 65 29 2c 20 31 30 2c |r->ar_si|ze), 10,|
|00000b80| 20 26 65 72 72 29 3b 0a | 09 69 66 20 28 65 72 72 | &err);.|.if (err|
|00000b90| 20 7c 7c 20 21 73 69 7a | 65 29 20 7b 0a 09 20 20 | || !siz|e) {.. |
|00000ba0| 20 20 62 72 65 61 6b 3b | 0a 09 7d 0a 09 6f 66 66 | break;|..}..off|
|00000bb0| 73 65 74 20 2b 3d 20 73 | 69 7a 65 6f 66 28 2a 68 |set += s|izeof(*h|
|00000bc0| 64 72 29 3b 0a 09 69 66 | 20 28 6f 66 66 73 65 74 |dr);..if| (offset|
|00000bd0| 20 2b 20 73 69 7a 65 20 | 3e 20 65 6c 66 2d 3e 65 | + size |> elf->e|
|00000be0| 5f 73 69 7a 65 29 20 7b | 0a 09 20 20 20 20 62 72 |_size) {|.. br|
|00000bf0| 65 61 6b 3b 0a 09 7d 0a | 09 69 66 20 28 68 64 72 |eak;..}.|.if (hdr|
|00000c00| 2d 3e 61 72 5f 6e 61 6d | 65 5b 31 5d 20 3d 3d 20 |->ar_nam|e[1] == |
|00000c10| 27 2f 27 20 26 26 20 68 | 64 72 2d 3e 61 72 5f 6e |'/' && h|dr->ar_n|
|00000c20| 61 6d 65 5b 32 5d 20 3d | 3d 20 27 20 27 29 20 7b |ame[2] =|= ' ') {|
|00000c30| 0a 09 20 20 20 20 65 6c | 66 2d 3e 65 5f 73 74 72 |.. el|f->e_str|
|00000c40| 74 61 62 20 3d 20 65 6c | 66 2d 3e 65 5f 64 61 74 |tab = el|f->e_dat|
|00000c50| 61 20 2b 20 6f 66 66 73 | 65 74 3b 0a 09 20 20 20 |a + offs|et;.. |
|00000c60| 20 65 6c 66 2d 3e 65 5f | 73 74 72 6c 65 6e 20 3d | elf->e_|strlen =|
|00000c70| 20 73 69 7a 65 3b 0a 09 | 20 20 20 20 62 72 65 61 | size;..| brea|
|00000c80| 6b 3b 0a 09 7d 0a 09 69 | 66 20 28 65 6c 66 2d 3e |k;..}..i|f (elf->|
|00000c90| 65 5f 73 79 6d 74 61 62 | 20 7c 7c 20 68 64 72 2d |e_symtab| || hdr-|
|00000ca0| 3e 61 72 5f 6e 61 6d 65 | 5b 31 5d 20 21 3d 20 27 |>ar_name|[1] != '|
|00000cb0| 20 27 29 20 7b 0a 09 20 | 20 20 20 62 72 65 61 6b | ') {.. | break|
|00000cc0| 3b 0a 09 7d 0a 09 65 6c | 66 2d 3e 65 5f 73 79 6d |;..}..el|f->e_sym|
|00000cd0| 74 61 62 20 3d 20 65 6c | 66 2d 3e 65 5f 64 61 74 |tab = el|f->e_dat|
|00000ce0| 61 20 2b 20 6f 66 66 73 | 65 74 3b 0a 09 65 6c 66 |a + offs|et;..elf|
|00000cf0| 2d 3e 65 5f 73 79 6d 6c | 65 6e 20 3d 20 73 69 7a |->e_syml|en = siz|
|00000d00| 65 3b 0a 09 6f 66 66 73 | 65 74 20 2b 3d 20 73 69 |e;..offs|et += si|
|00000d10| 7a 65 20 2b 20 28 73 69 | 7a 65 20 26 20 31 29 3b |ze + (si|ze & 1);|
|00000d20| 0a 20 20 20 20 7d 0a 7d | 0a 0a 73 74 61 74 69 63 |. }.}|..static|
|00000d30| 20 45 6c 66 5f 41 72 68 | 64 72 2a 0a 5f 65 6c 66 | Elf_Arh|dr*._elf|
|00000d40| 5f 61 72 68 64 72 28 45 | 6c 66 20 2a 61 72 66 29 |_arhdr(E|lf *arf)|
|00000d50| 20 7b 0a 20 20 20 20 73 | 74 72 75 63 74 20 61 72 | {. s|truct ar|
|00000d60| 5f 68 64 72 20 2a 68 64 | 72 3b 0a 20 20 20 20 45 |_hdr *hd|r;. E|
|00000d70| 6c 66 5f 41 72 68 64 72 | 20 2a 61 72 68 64 72 3b |lf_Arhdr| *arhdr;|
|00000d80| 0a 20 20 20 20 73 69 7a | 65 5f 74 20 6e 61 6d 65 |. siz|e_t name|
|00000d90| 6c 65 6e 3b 0a 20 20 20 | 20 73 69 7a 65 5f 74 20 |len;. | size_t |
|00000da0| 74 6d 70 3b 0a 20 20 20 | 20 63 68 61 72 20 2a 6e |tmp;. | char *n|
|00000db0| 61 6d 65 3b 0a 20 20 20 | 20 69 6e 74 20 65 72 72 |ame;. | int err|
|00000dc0| 20 3d 20 30 3b 0a 0a 20 | 20 20 20 69 66 20 28 61 | = 0;.. | if (a|
|00000dd0| 72 66 2d 3e 65 5f 6f 66 | 66 20 3d 3d 20 61 72 66 |rf->e_of|f == arf|
|00000de0| 2d 3e 65 5f 73 69 7a 65 | 29 20 7b 0a 09 2f 2a 20 |->e_size|) {../* |
|00000df0| 6e 6f 20 65 72 72 6f 72 | 21 20 2a 2f 0a 09 72 65 |no error|! */..re|
|00000e00| 74 75 72 6e 20 4e 55 4c | 4c 3b 0a 20 20 20 20 7d |turn NUL|L;. }|
|00000e10| 0a 20 20 20 20 69 66 20 | 28 61 72 66 2d 3e 65 5f |. if |(arf->e_|
|00000e20| 6f 66 66 20 3c 20 30 20 | 7c 7c 20 61 72 66 2d 3e |off < 0 ||| arf->|
|00000e30| 65 5f 6f 66 66 20 3e 20 | 61 72 66 2d 3e 65 5f 73 |e_off > |arf->e_s|
|00000e40| 69 7a 65 29 20 7b 0a 09 | 73 65 74 65 72 72 28 45 |ize) {..|seterr(E|
|00000e50| 52 52 4f 52 5f 4f 55 54 | 53 49 44 45 29 3b 0a 09 |RROR_OUT|SIDE);..|
|00000e60| 72 65 74 75 72 6e 20 4e | 55 4c 4c 3b 0a 20 20 20 |return N|ULL;. |
|00000e70| 20 7d 0a 20 20 20 20 69 | 66 20 28 61 72 66 2d 3e | }. i|f (arf->|
|00000e80| 65 5f 6f 66 66 20 2b 20 | 73 69 7a 65 6f 66 28 2a |e_off + |sizeof(*|
|00000e90| 68 64 72 29 20 3e 20 61 | 72 66 2d 3e 65 5f 73 69 |hdr) > a|rf->e_si|
|00000ea0| 7a 65 29 20 7b 0a 09 73 | 65 74 65 72 72 28 45 52 |ze) {..s|eterr(ER|
|00000eb0| 52 4f 52 5f 54 52 55 4e | 43 5f 41 52 48 44 52 29 |ROR_TRUN|C_ARHDR)|
|00000ec0| 3b 0a 09 72 65 74 75 72 | 6e 20 4e 55 4c 4c 3b 0a |;..retur|n NULL;.|
|00000ed0| 20 20 20 20 7d 0a 20 20 | 20 20 65 6c 66 5f 61 73 | }. | elf_as|
|00000ee0| 73 65 72 74 28 61 72 66 | 2d 3e 65 5f 64 61 74 61 |sert(arf|->e_data|
|00000ef0| 20 21 3d 20 4e 55 4c 4c | 29 3b 0a 20 20 20 20 68 | != NULL|);. h|
|00000f00| 64 72 20 3d 20 28 73 74 | 72 75 63 74 20 61 72 5f |dr = (st|ruct ar_|
|00000f10| 68 64 72 2a 29 28 61 72 | 66 2d 3e 65 5f 64 61 74 |hdr*)(ar|f->e_dat|
|00000f20| 61 20 2b 20 61 72 66 2d | 3e 65 5f 6f 66 66 29 3b |a + arf-|>e_off);|
|00000f30| 0a 20 20 20 20 69 66 20 | 28 6d 65 6d 63 6d 70 28 |. if |(memcmp(|
|00000f40| 68 64 72 2d 3e 61 72 5f | 66 6d 61 67 2c 20 66 6d |hdr->ar_|fmag, fm|
|00000f50| 61 67 2c 20 73 69 7a 65 | 6f 66 28 66 6d 61 67 29 |ag, size|of(fmag)|
|00000f60| 20 2d 20 31 29 29 20 7b | 0a 09 73 65 74 65 72 72 | - 1)) {|..seterr|
|00000f70| 28 45 52 52 4f 52 5f 41 | 52 46 4d 41 47 29 3b 0a |(ERROR_A|RFMAG);.|
|00000f80| 09 72 65 74 75 72 6e 20 | 4e 55 4c 4c 3b 0a 20 20 |.return |NULL;. |
|00000f90| 20 20 7d 0a 0a 20 20 20 | 20 6e 61 6d 65 20 3d 20 | }.. | name = |
|00000fa0| 68 64 72 2d 3e 61 72 5f | 6e 61 6d 65 3b 0a 20 20 |hdr->ar_|name;. |
|00000fb0| 20 20 66 6f 72 20 28 6e | 61 6d 65 6c 65 6e 20 3d | for (n|amelen =|
|00000fc0| 20 73 69 7a 65 6f 66 28 | 68 64 72 2d 3e 61 72 5f | sizeof(|hdr->ar_|
|00000fd0| 6e 61 6d 65 29 3b 20 6e | 61 6d 65 6c 65 6e 20 3e |name); n|amelen >|
|00000fe0| 20 30 3b 20 6e 61 6d 65 | 6c 65 6e 2d 2d 29 20 7b | 0; name|len--) {|
|00000ff0| 0a 09 69 66 20 28 6e 61 | 6d 65 5b 6e 61 6d 65 6c |..if (na|me[namel|
|00001000| 65 6e 20 2d 20 31 5d 20 | 21 3d 20 27 20 27 29 20 |en - 1] |!= ' ') |
|00001010| 7b 0a 09 20 20 20 20 62 | 72 65 61 6b 3b 0a 09 7d |{.. b|reak;..}|
|00001020| 0a 20 20 20 20 7d 0a 20 | 20 20 20 69 66 20 28 6e |. }. | if (n|
|00001030| 61 6d 65 5b 30 5d 20 3d | 3d 20 27 2f 27 29 20 7b |ame[0] =|= '/') {|
|00001040| 0a 09 69 66 20 28 6e 61 | 6d 65 5b 31 5d 20 3e 3d |..if (na|me[1] >=|
|00001050| 20 27 30 27 20 26 26 20 | 6e 61 6d 65 5b 31 5d 20 | '0' && |name[1] |
|00001060| 3c 3d 20 27 39 27 29 20 | 7b 0a 09 20 20 20 20 69 |<= '9') |{.. i|
|00001070| 66 20 28 21 61 72 66 2d | 3e 65 5f 73 74 72 74 61 |f (!arf-|>e_strta|
|00001080| 62 29 20 7b 0a 09 09 73 | 65 74 65 72 72 28 45 52 |b) {...s|eterr(ER|
|00001090| 52 4f 52 5f 41 52 53 54 | 52 54 41 42 29 3b 0a 09 |ROR_ARST|RTAB);..|
|000010a0| 09 72 65 74 75 72 6e 20 | 4e 55 4c 4c 3b 0a 09 20 |.return |NULL;.. |
|000010b0| 20 20 20 7d 0a 09 20 20 | 20 20 74 6d 70 20 3d 20 | }.. | tmp = |
|000010c0| 67 65 74 6e 75 6d 28 26 | 6e 61 6d 65 5b 31 5d 2c |getnum(&|name[1],|
|000010d0| 20 6e 61 6d 65 6c 65 6e | 20 2d 20 31 2c 20 31 30 | namelen| - 1, 10|
|000010e0| 2c 20 26 65 72 72 29 3b | 0a 09 20 20 20 20 69 66 |, &err);|.. if|
|000010f0| 20 28 65 72 72 29 20 7b | 0a 09 09 73 65 74 65 72 | (err) {|...seter|
|00001100| 72 28 45 52 52 4f 52 5f | 41 52 53 50 45 43 49 41 |r(ERROR_|ARSPECIA|
|00001110| 4c 29 3b 0a 09 09 72 65 | 74 75 72 6e 20 4e 55 4c |L);...re|turn NUL|
|00001120| 4c 3b 0a 09 20 20 20 20 | 7d 0a 09 20 20 20 20 69 |L;.. |}.. i|
|00001130| 66 20 28 74 6d 70 20 3c | 20 30 20 7c 7c 20 74 6d |f (tmp <| 0 || tm|
|00001140| 70 20 3e 3d 20 61 72 66 | 2d 3e 65 5f 73 74 72 6c |p >= arf|->e_strl|
|00001150| 65 6e 29 20 7b 0a 09 09 | 73 65 74 65 72 72 28 45 |en) {...|seterr(E|
|00001160| 52 52 4f 52 5f 41 52 53 | 54 52 54 41 42 29 3b 0a |RROR_ARS|TRTAB);.|
|00001170| 09 09 72 65 74 75 72 6e | 20 4e 55 4c 4c 3b 0a 09 |..return| NULL;..|
|00001180| 20 20 20 20 7d 0a 09 20 | 20 20 20 6e 61 6d 65 20 | }.. | name |
|00001190| 3d 20 61 72 66 2d 3e 65 | 5f 73 74 72 74 61 62 20 |= arf->e|_strtab |
|000011a0| 2b 20 74 6d 70 3b 0a 09 | 20 20 20 20 66 6f 72 20 |+ tmp;..| for |
|000011b0| 28 6e 61 6d 65 6c 65 6e | 20 3d 20 74 6d 70 3b 20 |(namelen| = tmp; |
|000011c0| 6e 61 6d 65 6c 65 6e 20 | 3c 20 61 72 66 2d 3e 65 |namelen |< arf->e|
|000011d0| 5f 73 74 72 6c 65 6e 3b | 20 6e 61 6d 65 6c 65 6e |_strlen;| namelen|
|000011e0| 2b 2b 29 20 7b 0a 09 09 | 69 66 20 28 6e 61 6d 65 |++) {...|if (name|
|000011f0| 5b 6e 61 6d 65 6c 65 6e | 5d 20 3d 3d 20 27 2f 27 |[namelen|] == '/'|
|00001200| 29 20 7b 0a 09 09 20 20 | 20 20 6e 61 6d 65 6c 65 |) {... | namele|
|00001210| 6e 20 2d 3d 20 74 6d 70 | 3b 0a 09 09 20 20 20 20 |n -= tmp|;... |
|00001220| 62 72 65 61 6b 3b 0a 09 | 09 7d 0a 09 20 20 20 20 |break;..|.}.. |
|00001230| 7d 0a 09 20 20 20 20 69 | 66 20 28 6e 61 6d 65 6c |}.. i|f (namel|
|00001240| 65 6e 20 3d 3d 20 61 72 | 66 2d 3e 65 5f 73 74 72 |en == ar|f->e_str|
|00001250| 6c 65 6e 29 20 7b 0a 09 | 09 73 65 74 65 72 72 28 |len) {..|.seterr(|
|00001260| 45 52 52 4f 52 5f 41 52 | 53 54 52 54 41 42 29 3b |ERROR_AR|STRTAB);|
|00001270| 0a 09 09 72 65 74 75 72 | 6e 20 4e 55 4c 4c 3b 0a |...retur|n NULL;.|
|00001280| 09 20 20 20 20 7d 0a 09 | 7d 0a 09 65 6c 73 65 20 |. }..|}..else |
|00001290| 69 66 20 28 6e 61 6d 65 | 6c 65 6e 20 21 3d 20 31 |if (name|len != 1|
|000012a0| 20 26 26 20 21 28 6e 61 | 6d 65 6c 65 6e 20 3d 3d | && !(na|melen ==|
|000012b0| 20 32 20 26 26 20 6e 61 | 6d 65 5b 31 5d 20 3d 3d | 2 && na|me[1] ==|
|000012c0| 20 27 2f 27 29 29 20 7b | 0a 09 20 20 20 20 73 65 | '/')) {|.. se|
|000012d0| 74 65 72 72 28 45 52 52 | 4f 52 5f 41 52 53 50 45 |terr(ERR|OR_ARSPE|
|000012e0| 43 49 41 4c 29 3b 0a 09 | 20 20 20 20 72 65 74 75 |CIAL);..| retu|
|000012f0| 72 6e 20 4e 55 4c 4c 3b | 0a 09 7d 0a 20 20 20 20 |rn NULL;|..}. |
|00001300| 7d 0a 20 20 20 20 65 6c | 73 65 20 69 66 20 28 6e |}. el|se if (n|
|00001310| 61 6d 65 6c 65 6e 20 3e | 20 30 20 26 26 20 6e 61 |amelen >| 0 && na|
|00001320| 6d 65 5b 6e 61 6d 65 6c | 65 6e 20 2d 20 31 5d 20 |me[namel|en - 1] |
|00001330| 3d 3d 20 27 2f 27 29 20 | 7b 0a 09 6e 61 6d 65 6c |== '/') |{..namel|
|00001340| 65 6e 2d 2d 3b 0a 20 20 | 20 20 7d 0a 20 20 20 20 |en--;. | }. |
|00001350| 65 6c 73 65 20 7b 0a 09 | 6e 61 6d 65 6c 65 6e 20 |else {..|namelen |
|00001360| 3d 20 30 3b 0a 20 20 20 | 20 7d 0a 0a 20 20 20 20 |= 0;. | }.. |
|00001370| 69 66 20 28 21 28 61 72 | 68 64 72 20 3d 20 28 45 |if (!(ar|hdr = (E|
|00001380| 6c 66 5f 41 72 68 64 72 | 2a 29 6d 61 6c 6c 6f 63 |lf_Arhdr|*)malloc|
|00001390| 28 73 69 7a 65 6f 66 28 | 2a 61 72 68 64 72 29 20 |(sizeof(|*arhdr) |
|000013a0| 2b 0a 09 09 20 20 20 20 | 20 73 69 7a 65 6f 66 28 |+... | sizeof(|
|000013b0| 68 64 72 2d 3e 61 72 5f | 6e 61 6d 65 29 20 2b 20 |hdr->ar_|name) + |
|000013c0| 6e 61 6d 65 6c 65 6e 20 | 2b 20 32 29 29 29 20 7b |namelen |+ 2))) {|
|000013d0| 0a 09 73 65 74 65 72 72 | 28 45 52 52 4f 52 5f 4d |..seterr|(ERROR_M|
|000013e0| 45 4d 5f 41 52 48 44 52 | 29 3b 0a 09 72 65 74 75 |EM_ARHDR|);..retu|
|000013f0| 72 6e 20 4e 55 4c 4c 3b | 0a 20 20 20 20 7d 0a 0a |rn NULL;|. }..|
|00001400| 20 20 20 20 61 72 68 64 | 72 2d 3e 61 72 5f 6e 61 | arhd|r->ar_na|
|00001410| 6d 65 20 3d 20 4e 55 4c | 4c 3b 0a 20 20 20 20 61 |me = NUL|L;. a|
|00001420| 72 68 64 72 2d 3e 61 72 | 5f 72 61 77 6e 61 6d 65 |rhdr->ar|_rawname|
|00001430| 20 3d 20 28 63 68 61 72 | 2a 29 28 61 72 68 64 72 | = (char|*)(arhdr|
|00001440| 20 2b 20 31 29 3b 0a 20 | 20 20 20 61 72 68 64 72 | + 1);. | arhdr|
|00001450| 2d 3e 61 72 5f 64 61 74 | 65 20 3d 20 67 65 74 6e |->ar_dat|e = getn|
|00001460| 75 6d 28 68 64 72 2d 3e | 61 72 5f 64 61 74 65 2c |um(hdr->|ar_date,|
|00001470| 20 73 69 7a 65 6f 66 28 | 68 64 72 2d 3e 61 72 5f | sizeof(|hdr->ar_|
|00001480| 64 61 74 65 29 2c 20 31 | 30 2c 20 26 65 72 72 29 |date), 1|0, &err)|
|00001490| 3b 0a 20 20 20 20 61 72 | 68 64 72 2d 3e 61 72 5f |;. ar|hdr->ar_|
|000014a0| 75 69 64 20 3d 20 67 65 | 74 6e 75 6d 28 68 64 72 |uid = ge|tnum(hdr|
|000014b0| 2d 3e 61 72 5f 75 69 64 | 2c 20 73 69 7a 65 6f 66 |->ar_uid|, sizeof|
|000014c0| 28 68 64 72 2d 3e 61 72 | 5f 75 69 64 29 2c 20 31 |(hdr->ar|_uid), 1|
|000014d0| 30 2c 20 26 65 72 72 29 | 3b 0a 20 20 20 20 61 72 |0, &err)|;. ar|
|000014e0| 68 64 72 2d 3e 61 72 5f | 67 69 64 20 3d 20 67 65 |hdr->ar_|gid = ge|
|000014f0| 74 6e 75 6d 28 68 64 72 | 2d 3e 61 72 5f 67 69 64 |tnum(hdr|->ar_gid|
|00001500| 2c 20 73 69 7a 65 6f 66 | 28 68 64 72 2d 3e 61 72 |, sizeof|(hdr->ar|
|00001510| 5f 67 69 64 29 2c 20 31 | 30 2c 20 26 65 72 72 29 |_gid), 1|0, &err)|
|00001520| 3b 0a 20 20 20 20 61 72 | 68 64 72 2d 3e 61 72 5f |;. ar|hdr->ar_|
|00001530| 6d 6f 64 65 20 3d 20 67 | 65 74 6e 75 6d 28 68 64 |mode = g|etnum(hd|
|00001540| 72 2d 3e 61 72 5f 6d 6f | 64 65 2c 20 73 69 7a 65 |r->ar_mo|de, size|
|00001550| 6f 66 28 68 64 72 2d 3e | 61 72 5f 6d 6f 64 65 29 |of(hdr->|ar_mode)|
|00001560| 2c 20 38 2c 20 26 65 72 | 72 29 3b 0a 20 20 20 20 |, 8, &er|r);. |
|00001570| 61 72 68 64 72 2d 3e 61 | 72 5f 73 69 7a 65 20 3d |arhdr->a|r_size =|
|00001580| 20 67 65 74 6e 75 6d 28 | 68 64 72 2d 3e 61 72 5f | getnum(|hdr->ar_|
|00001590| 73 69 7a 65 2c 20 73 69 | 7a 65 6f 66 28 68 64 72 |size, si|zeof(hdr|
|000015a0| 2d 3e 61 72 5f 73 69 7a | 65 29 2c 20 31 30 2c 20 |->ar_siz|e), 10, |
|000015b0| 26 65 72 72 29 3b 0a 20 | 20 20 20 69 66 20 28 65 |&err);. | if (e|
|000015c0| 72 72 29 20 7b 0a 09 66 | 72 65 65 28 61 72 68 64 |rr) {..f|ree(arhd|
|000015d0| 72 29 3b 0a 09 73 65 74 | 65 72 72 28 45 52 52 4f |r);..set|err(ERRO|
|000015e0| 52 5f 41 52 48 44 52 29 | 3b 0a 09 72 65 74 75 72 |R_ARHDR)|;..retur|
|000015f0| 6e 20 4e 55 4c 4c 3b 0a | 20 20 20 20 7d 0a 0a 20 |n NULL;.| }.. |
|00001600| 20 20 20 6d 65 6d 63 70 | 79 28 61 72 68 64 72 2d | memcp|y(arhdr-|
|00001610| 3e 61 72 5f 72 61 77 6e | 61 6d 65 2c 20 68 64 72 |>ar_rawn|ame, hdr|
|00001620| 2d 3e 61 72 5f 6e 61 6d | 65 2c 20 73 69 7a 65 6f |->ar_nam|e, sizeo|
|00001630| 66 28 68 64 72 2d 3e 61 | 72 5f 6e 61 6d 65 29 29 |f(hdr->a|r_name))|
|00001640| 3b 0a 20 20 20 20 61 72 | 68 64 72 2d 3e 61 72 5f |;. ar|hdr->ar_|
|00001650| 72 61 77 6e 61 6d 65 5b | 73 69 7a 65 6f 66 28 68 |rawname[|sizeof(h|
|00001660| 64 72 2d 3e 61 72 5f 6e | 61 6d 65 29 5d 20 3d 20 |dr->ar_n|ame)] = |
|00001670| 27 5c 30 27 3b 0a 0a 20 | 20 20 20 69 66 20 28 6e |'\0';.. | if (n|
|00001680| 61 6d 65 6c 65 6e 29 20 | 7b 0a 09 61 72 68 64 72 |amelen) |{..arhdr|
|00001690| 2d 3e 61 72 5f 6e 61 6d | 65 20 3d 20 61 72 68 64 |->ar_nam|e = arhd|
|000016a0| 72 2d 3e 61 72 5f 72 61 | 77 6e 61 6d 65 20 2b 20 |r->ar_ra|wname + |
|000016b0| 73 69 7a 65 6f 66 28 68 | 64 72 2d 3e 61 72 5f 6e |sizeof(h|dr->ar_n|
|000016c0| 61 6d 65 29 20 2b 20 31 | 3b 0a 09 6d 65 6d 63 70 |ame) + 1|;..memcp|
|000016d0| 79 28 61 72 68 64 72 2d | 3e 61 72 5f 6e 61 6d 65 |y(arhdr-|>ar_name|
|000016e0| 2c 20 6e 61 6d 65 2c 20 | 6e 61 6d 65 6c 65 6e 29 |, name, |namelen)|
|000016f0| 3b 0a 09 61 72 68 64 72 | 2d 3e 61 72 5f 6e 61 6d |;..arhdr|->ar_nam|
|00001700| 65 5b 6e 61 6d 65 6c 65 | 6e 5d 20 3d 20 27 5c 30 |e[namele|n] = '\0|
|00001710| 27 3b 0a 20 20 20 20 7d | 0a 0a 20 20 20 20 72 65 |';. }|.. re|
|00001720| 74 75 72 6e 20 61 72 68 | 64 72 3b 0a 7d 0a 0a 45 |turn arh|dr;.}..E|
|00001730| 6c 66 2a 0a 65 6c 66 5f | 62 65 67 69 6e 28 69 6e |lf*.elf_|begin(in|
|00001740| 74 20 66 64 2c 20 45 6c | 66 5f 43 6d 64 20 63 6d |t fd, El|f_Cmd cm|
|00001750| 64 2c 20 45 6c 66 20 2a | 72 65 66 29 20 7b 0a 20 |d, Elf *|ref) {. |
|00001760| 20 20 20 45 6c 66 5f 41 | 72 68 64 72 20 2a 61 72 | Elf_A|rhdr *ar|
|00001770| 68 64 72 20 3d 20 4e 55 | 4c 4c 3b 0a 20 20 20 20 |hdr = NU|LL;. |
|00001780| 73 69 7a 65 5f 74 20 73 | 69 7a 65 20 3d 20 30 3b |size_t s|ize = 0;|
|00001790| 0a 20 20 20 20 45 6c 66 | 20 2a 65 6c 66 3b 0a 0a |. Elf| *elf;..|
|000017a0| 20 20 20 20 65 6c 66 5f | 61 73 73 65 72 74 28 5f | elf_|assert(_|
|000017b0| 65 6c 66 5f 69 6e 69 74 | 2e 65 5f 6d 61 67 69 63 |elf_init|.e_magic|
|000017c0| 20 3d 3d 20 45 4c 46 5f | 4d 41 47 49 43 29 3b 0a | == ELF_|MAGIC);.|
|000017d0| 20 20 20 20 69 66 20 28 | 5f 65 6c 66 5f 76 65 72 | if (|_elf_ver|
|000017e0| 73 69 6f 6e 20 3d 3d 20 | 45 56 5f 4e 4f 4e 45 29 |sion == |EV_NONE)|
|000017f0| 20 7b 0a 09 73 65 74 65 | 72 72 28 45 52 52 4f 52 | {..sete|rr(ERROR|
|00001800| 5f 56 45 52 53 49 4f 4e | 5f 55 4e 53 45 54 29 3b |_VERSION|_UNSET);|
|00001810| 0a 09 72 65 74 75 72 6e | 20 4e 55 4c 4c 3b 0a 20 |..return| NULL;. |
|00001820| 20 20 20 7d 0a 20 20 20 | 20 65 6c 73 65 20 69 66 | }. | else if|
|00001830| 20 28 63 6d 64 20 3d 3d | 20 45 4c 46 5f 43 5f 4e | (cmd ==| ELF_C_N|
|00001840| 55 4c 4c 29 20 7b 0a 09 | 72 65 74 75 72 6e 20 4e |ULL) {..|return N|
|00001850| 55 4c 4c 3b 0a 20 20 20 | 20 7d 0a 20 20 20 20 65 |ULL;. | }. e|
|00001860| 6c 73 65 20 69 66 20 28 | 63 6d 64 20 3d 3d 20 45 |lse if (|cmd == E|
|00001870| 4c 46 5f 43 5f 57 52 49 | 54 45 29 20 7b 0a 09 72 |LF_C_WRI|TE) {..r|
|00001880| 65 66 20 3d 20 4e 55 4c | 4c 3b 0a 20 20 20 20 7d |ef = NUL|L;. }|
|00001890| 0a 20 20 20 20 65 6c 73 | 65 20 69 66 20 28 63 6d |. els|e if (cm|
|000018a0| 64 20 21 3d 20 45 4c 46 | 5f 43 5f 52 45 41 44 20 |d != ELF|_C_READ |
|000018b0| 26 26 20 63 6d 64 20 21 | 3d 20 45 4c 46 5f 43 5f |&& cmd !|= ELF_C_|
|000018c0| 52 44 57 52 29 20 7b 0a | 09 73 65 74 65 72 72 28 |RDWR) {.|.seterr(|
|000018d0| 45 52 52 4f 52 5f 49 4e | 56 41 4c 49 44 5f 43 4d |ERROR_IN|VALID_CM|
|000018e0| 44 29 3b 0a 09 72 65 74 | 75 72 6e 20 4e 55 4c 4c |D);..ret|urn NULL|
|000018f0| 3b 0a 20 20 20 20 7d 0a | 20 20 20 20 65 6c 73 65 |;. }.| else|
|00001900| 20 69 66 20 28 72 65 66 | 29 20 7b 0a 09 65 6c 66 | if (ref|) {..elf|
|00001910| 5f 61 73 73 65 72 74 28 | 72 65 66 2d 3e 65 5f 6d |_assert(|ref->e_m|
|00001920| 61 67 69 63 20 3d 3d 20 | 45 4c 46 5f 4d 41 47 49 |agic == |ELF_MAGI|
|00001930| 43 29 3b 0a 09 69 66 20 | 28 21 72 65 66 2d 3e 65 |C);..if |(!ref->e|
|00001940| 5f 72 65 61 64 61 62 6c | 65 20 7c 7c 20 28 63 6d |_readabl|e || (cm|
|00001950| 64 20 3d 3d 20 45 4c 46 | 5f 43 5f 52 44 57 52 20 |d == ELF|_C_RDWR |
|00001960| 26 26 20 21 72 65 66 2d | 3e 65 5f 77 72 69 74 61 |&& !ref-|>e_writa|
|00001970| 62 6c 65 29 29 20 7b 0a | 09 20 20 20 20 73 65 74 |ble)) {.|. set|
|00001980| 65 72 72 28 45 52 52 4f | 52 5f 43 4d 44 4d 49 53 |err(ERRO|R_CMDMIS|
|00001990| 4d 41 54 43 48 29 3b 0a | 09 20 20 20 20 72 65 74 |MATCH);.|. ret|
|000019a0| 75 72 6e 20 4e 55 4c 4c | 3b 0a 09 7d 0a 09 69 66 |urn NULL|;..}..if|
|000019b0| 20 28 72 65 66 2d 3e 65 | 5f 6b 69 6e 64 20 21 3d | (ref->e|_kind !=|
|000019c0| 20 45 4c 46 5f 4b 5f 41 | 52 29 20 7b 0a 09 20 20 | ELF_K_A|R) {.. |
|000019d0| 20 20 72 65 66 2d 3e 65 | 5f 63 6f 75 6e 74 2b 2b | ref->e|_count++|
|000019e0| 3b 0a 09 20 20 20 20 72 | 65 74 75 72 6e 20 72 65 |;.. r|eturn re|
|000019f0| 66 3b 0a 09 7d 0a 09 69 | 66 20 28 63 6d 64 20 3d |f;..}..i|f (cmd =|
|00001a00| 3d 20 45 4c 46 5f 43 5f | 52 44 57 52 29 20 7b 0a |= ELF_C_|RDWR) {.|
|00001a10| 09 20 20 20 20 73 65 74 | 65 72 72 28 45 52 52 4f |. set|err(ERRO|
|00001a20| 52 5f 4d 45 4d 42 45 52 | 57 52 49 54 45 29 3b 0a |R_MEMBER|WRITE);.|
|00001a30| 09 20 20 20 20 72 65 74 | 75 72 6e 20 4e 55 4c 4c |. ret|urn NULL|
|00001a40| 3b 0a 09 7d 0a 09 69 66 | 20 28 66 64 20 21 3d 20 |;..}..if| (fd != |
|00001a50| 72 65 66 2d 3e 65 5f 66 | 64 29 20 7b 0a 09 20 20 |ref->e_f|d) {.. |
|00001a60| 20 20 73 65 74 65 72 72 | 28 45 52 52 4f 52 5f 46 | seterr|(ERROR_F|
|00001a70| 44 4d 49 53 4d 41 54 43 | 48 29 3b 0a 09 20 20 20 |DMISMATC|H);.. |
|00001a80| 20 72 65 74 75 72 6e 20 | 4e 55 4c 4c 3b 0a 09 7d | return |NULL;..}|
|00001a90| 0a 09 69 66 20 28 21 28 | 61 72 68 64 72 20 3d 20 |..if (!(|arhdr = |
|00001aa0| 5f 65 6c 66 5f 61 72 68 | 64 72 28 72 65 66 29 29 |_elf_arh|dr(ref))|
|00001ab0| 29 20 7b 0a 09 20 20 20 | 20 72 65 74 75 72 6e 20 |) {.. | return |
|00001ac0| 4e 55 4c 4c 3b 0a 09 7d | 0a 09 73 69 7a 65 20 3d |NULL;..}|..size =|
|00001ad0| 20 61 72 68 64 72 2d 3e | 61 72 5f 73 69 7a 65 3b | arhdr->|ar_size;|
|00001ae0| 0a 20 20 20 20 7d 0a 20 | 20 20 20 65 6c 73 65 20 |. }. | else |
|00001af0| 69 66 20 28 28 73 69 7a | 65 20 3d 20 6c 73 65 65 |if ((siz|e = lsee|
|00001b00| 6b 28 66 64 2c 20 30 4c | 2c 20 32 29 29 20 3d 3d |k(fd, 0L|, 2)) ==|
|00001b10| 20 28 73 69 7a 65 5f 74 | 29 2d 31 4c 29 20 7b 0a | (size_t|)-1L) {.|
|00001b20| 09 73 65 74 65 72 72 28 | 45 52 52 4f 52 5f 49 4f |.seterr(|ERROR_IO|
|00001b30| 5f 47 45 54 53 49 5a 45 | 29 3b 0a 09 72 65 74 75 |_GETSIZE|);..retu|
|00001b40| 72 6e 20 4e 55 4c 4c 3b | 0a 20 20 20 20 7d 0a 0a |rn NULL;|. }..|
|00001b50| 20 20 20 20 69 66 20 28 | 21 28 65 6c 66 20 3d 20 | if (|!(elf = |
|00001b60| 28 45 6c 66 2a 29 6d 61 | 6c 6c 6f 63 28 73 69 7a |(Elf*)ma|lloc(siz|
|00001b70| 65 6f 66 28 45 6c 66 29 | 29 29 29 20 7b 0a 09 73 |eof(Elf)|))) {..s|
|00001b80| 65 74 65 72 72 28 45 52 | 52 4f 52 5f 4d 45 4d 5f |eterr(ER|ROR_MEM_|
|00001b90| 45 4c 46 29 3b 0a 09 72 | 65 74 75 72 6e 20 4e 55 |ELF);..r|eturn NU|
|00001ba0| 4c 4c 3b 0a 20 20 20 20 | 7d 0a 20 20 20 20 2a 65 |LL;. |}. *e|
|00001bb0| 6c 66 20 3d 20 5f 65 6c | 66 5f 69 6e 69 74 3b 0a |lf = _el|f_init;.|
|00001bc0| 20 20 20 20 65 6c 66 2d | 3e 65 5f 66 64 20 3d 20 | elf-|>e_fd = |
|00001bd0| 66 64 3b 0a 20 20 20 20 | 65 6c 66 2d 3e 65 5f 70 |fd;. |elf->e_p|
|00001be0| 61 72 65 6e 74 20 3d 20 | 72 65 66 3b 0a 20 20 20 |arent = |ref;. |
|00001bf0| 20 65 6c 66 2d 3e 65 5f | 73 69 7a 65 20 3d 20 73 | elf->e_|size = s|
|00001c00| 69 7a 65 3b 0a 0a 20 20 | 20 20 69 66 20 28 63 6d |ize;.. | if (cm|
|00001c10| 64 20 21 3d 20 45 4c 46 | 5f 43 5f 52 45 41 44 29 |d != ELF|_C_READ)|
|00001c20| 20 7b 0a 09 65 6c 66 2d | 3e 65 5f 77 72 69 74 61 | {..elf-|>e_writa|
|00001c30| 62 6c 65 20 3d 20 31 3b | 0a 20 20 20 20 7d 0a 20 |ble = 1;|. }. |
|00001c40| 20 20 20 69 66 20 28 63 | 6d 64 20 21 3d 20 45 4c | if (c|md != EL|
|00001c50| 46 5f 43 5f 57 52 49 54 | 45 29 20 7b 0a 09 65 6c |F_C_WRIT|E) {..el|
|00001c60| 66 2d 3e 65 5f 72 65 61 | 64 61 62 6c 65 20 3d 20 |f->e_rea|dable = |
|00001c70| 31 3b 0a 20 20 20 20 7d | 0a 20 20 20 20 65 6c 73 |1;. }|. els|
|00001c80| 65 20 7b 0a 09 72 65 74 | 75 72 6e 20 65 6c 66 3b |e {..ret|urn elf;|
|00001c90| 0a 20 20 20 20 7d 0a 0a | 20 20 20 20 69 66 20 28 |. }..| if (|
|00001ca0| 72 65 66 29 20 7b 0a 09 | 73 69 7a 65 5f 74 20 6f |ref) {..|size_t o|
|00001cb0| 66 66 73 65 74 20 3d 20 | 72 65 66 2d 3e 65 5f 6f |ffset = |ref->e_o|
|00001cc0| 66 66 20 2b 20 73 69 7a | 65 6f 66 28 73 74 72 75 |ff + siz|eof(stru|
|00001cd0| 63 74 20 61 72 5f 68 64 | 72 29 3b 0a 09 45 6c 66 |ct ar_hd|r);..Elf|
|00001ce0| 20 2a 78 65 6c 66 3b 0a | 0a 09 65 6c 66 5f 61 73 | *xelf;.|..elf_as|
|00001cf0| 73 65 72 74 28 61 72 68 | 64 72 29 3b 0a 09 65 6c |sert(arh|dr);..el|
|00001d00| 66 2d 3e 65 5f 61 72 68 | 64 72 20 3d 20 61 72 68 |f->e_arh|dr = arh|
|00001d10| 64 72 3b 0a 09 65 6c 66 | 2d 3e 65 5f 62 61 73 65 |dr;..elf|->e_base|
|00001d20| 20 3d 20 72 65 66 2d 3e | 65 5f 62 61 73 65 20 2b | = ref->|e_base +|
|00001d30| 20 6f 66 66 73 65 74 3b | 0a 09 2f 2a 0a 09 20 2a | offset;|../*.. *|
|00001d40| 20 53 68 61 72 65 20 74 | 68 65 20 61 72 63 68 69 | Share t|he archi|
|00001d50| 76 65 27 73 20 6d 65 6d | 6f 72 79 20 69 6d 61 67 |ve's mem|ory imag|
|00001d60| 65 2e 20 54 6f 20 61 76 | 6f 69 64 0a 09 20 2a 20 |e. To av|oid.. * |
|00001d70| 6d 75 6c 74 69 70 6c 65 | 20 69 6e 64 65 70 65 6e |multiple| indepen|
|00001d80| 64 65 6e 74 20 65 6c 66 | 20 64 65 73 63 72 69 70 |dent elf| descrip|
|00001d90| 74 6f 72 73 20 69 66 20 | 74 68 65 0a 09 20 2a 20 |tors if |the.. * |
|00001da0| 73 61 6d 65 20 6d 65 6d | 62 65 72 20 69 73 20 72 |same mem|ber is r|
|00001db0| 65 71 75 65 73 74 65 64 | 20 74 77 69 63 65 2c 20 |equested| twice, |
|00001dc0| 73 63 61 6e 20 74 68 65 | 20 6c 69 73 74 0a 09 20 |scan the| list.. |
|00001dd0| 2a 20 6f 66 20 6f 70 65 | 6e 20 6d 65 6d 62 65 72 |* of ope|n member|
|00001de0| 73 20 66 6f 72 20 64 75 | 70 6c 69 63 61 74 65 73 |s for du|plicates|
|00001df0| 2e 0a 09 20 2a 0a 09 20 | 2a 20 49 20 64 6f 6e 27 |... *.. |* I don'|
|00001e00| 74 20 6b 6e 6f 77 20 68 | 6f 77 20 53 56 52 34 20 |t know h|ow SVR4 |
|00001e10| 68 61 6e 64 6c 65 73 20 | 74 68 69 73 20 63 61 73 |handles |this cas|
|00001e20| 65 2e 20 44 6f 6e 27 74 | 20 72 65 6c 79 20 6f 6e |e. Don't| rely on|
|00001e30| 20 69 74 2e 0a 09 20 2a | 2f 0a 09 66 6f 72 20 28 | it... *|/..for (|
|00001e40| 78 65 6c 66 20 3d 20 72 | 65 66 2d 3e 65 5f 6d 65 |xelf = r|ef->e_me|
|00001e50| 6d 62 65 72 73 3b 20 78 | 65 6c 66 3b 20 78 65 6c |mbers; x|elf; xel|
|00001e60| 66 20 3d 20 78 65 6c 66 | 2d 3e 65 5f 6c 69 6e 6b |f = xelf|->e_link|
|00001e70| 29 20 7b 0a 09 20 20 20 | 20 65 6c 66 5f 61 73 73 |) {.. | elf_ass|
|00001e80| 65 72 74 28 78 65 6c 66 | 2d 3e 65 5f 70 61 72 65 |ert(xelf|->e_pare|
|00001e90| 6e 74 20 3d 3d 20 72 65 | 66 29 3b 0a 09 20 20 20 |nt == re|f);.. |
|00001ea0| 20 69 66 20 28 78 65 6c | 66 2d 3e 65 5f 62 61 73 | if (xel|f->e_bas|
|00001eb0| 65 20 3d 3d 20 65 6c 66 | 2d 3e 65 5f 62 61 73 65 |e == elf|->e_base|
|00001ec0| 29 20 7b 0a 09 09 66 72 | 65 65 28 61 72 68 64 72 |) {...fr|ee(arhdr|
|00001ed0| 29 3b 0a 09 09 66 72 65 | 65 28 65 6c 66 29 3b 0a |);...fre|e(elf);.|
|00001ee0| 09 09 78 65 6c 66 2d 3e | 65 5f 63 6f 75 6e 74 2b |..xelf->|e_count+|
|00001ef0| 2b 3b 0a 09 09 72 65 74 | 75 72 6e 20 78 65 6c 66 |+;...ret|urn xelf|
|00001f00| 3b 0a 09 20 20 20 20 7d | 0a 09 7d 0a 09 65 6c 66 |;.. }|..}..elf|
|00001f10| 2d 3e 65 5f 64 61 74 61 | 20 3d 20 73 69 7a 65 20 |->e_data| = size |
|00001f20| 3f 20 72 65 66 2d 3e 65 | 5f 64 61 74 61 20 2b 20 |? ref->e|_data + |
|00001f30| 6f 66 66 73 65 74 20 3a | 20 28 63 68 61 72 2a 29 |offset :| (char*)|
|00001f40| 4e 55 4c 4c 3b 0a 09 65 | 6c 66 2d 3e 65 5f 6e 65 |NULL;..e|lf->e_ne|
|00001f50| 78 74 20 3d 20 6f 66 66 | 73 65 74 20 2b 20 73 69 |xt = off|set + si|
|00001f60| 7a 65 20 2b 20 28 73 69 | 7a 65 20 26 20 31 29 3b |ze + (si|ze & 1);|
|00001f70| 0a 09 65 6c 66 2d 3e 65 | 5f 64 69 73 61 62 6c 65 |..elf->e|_disable|
|00001f80| 64 20 3d 20 72 65 66 2d | 3e 65 5f 64 69 73 61 62 |d = ref-|>e_disab|
|00001f90| 6c 65 64 3b 0a 09 2f 2a | 20 70 61 72 65 6e 74 2f |led;../*| parent/|
|00001fa0| 63 68 69 6c 64 20 6c 69 | 6e 6b 69 6e 67 20 2a 2f |child li|nking */|
|00001fb0| 0a 09 65 6c 66 2d 3e 65 | 5f 6c 69 6e 6b 20 3d 20 |..elf->e|_link = |
|00001fc0| 72 65 66 2d 3e 65 5f 6d | 65 6d 62 65 72 73 3b 0a |ref->e_m|embers;.|
|00001fd0| 09 72 65 66 2d 3e 65 5f | 6d 65 6d 62 65 72 73 20 |.ref->e_|members |
|00001fe0| 3d 20 65 6c 66 3b 0a 09 | 72 65 66 2d 3e 65 5f 63 |= elf;..|ref->e_c|
|00001ff0| 6f 75 6e 74 2b 2b 3b 0a | 09 2f 2a 20 53 6c 6f 77 |ount++;.|./* Slow|
|00002000| 61 72 69 73 20 63 6f 6d | 70 61 74 69 62 69 6c 69 |aris com|patibili|
|00002010| 74 79 20 2d 20 64 6f 20 | 6e 6f 74 20 72 65 6c 79 |ty - do |not rely|
|00002020| 20 6f 6e 20 74 68 69 73 | 21 20 2a 2f 0a 09 72 65 | on this|! */..re|
|00002030| 66 2d 3e 65 5f 6f 66 66 | 20 3d 20 65 6c 66 2d 3e |f->e_off| = elf->|
|00002040| 65 5f 6e 65 78 74 3b 0a | 20 20 20 20 7d 0a 20 20 |e_next;.| }. |
|00002050| 20 20 65 6c 73 65 20 69 | 66 20 28 73 69 7a 65 20 | else i|f (size |
|00002060| 26 26 20 21 28 65 6c 66 | 2d 3e 65 5f 64 61 74 61 |&& !(elf|->e_data|
|00002070| 20 3d 20 5f 65 6c 66 5f | 72 65 61 64 28 65 6c 66 | = _elf_|read(elf|
|00002080| 2c 20 4e 55 4c 4c 2c 20 | 30 2c 20 73 69 7a 65 29 |, NULL, |0, size)|
|00002090| 29 29 20 7b 0a 09 66 72 | 65 65 28 65 6c 66 29 3b |)) {..fr|ee(elf);|
|000020a0| 0a 09 72 65 74 75 72 6e | 20 4e 55 4c 4c 3b 0a 20 |..return| NULL;. |
|000020b0| 20 20 20 7d 0a 0a 20 20 | 20 20 65 6c 66 2d 3e 65 | }.. | elf->e|
|000020c0| 5f 69 64 6c 65 6e 20 3d | 20 73 69 7a 65 3b 0a 20 |_idlen =| size;. |
|000020d0| 20 20 20 69 66 20 28 73 | 69 7a 65 20 3e 3d 20 45 | if (s|ize >= E|
|000020e0| 49 5f 4e 49 44 45 4e 54 | 20 26 26 20 21 6d 65 6d |I_NIDENT| && !mem|
|000020f0| 63 6d 70 28 65 6c 66 2d | 3e 65 5f 64 61 74 61 2c |cmp(elf-|>e_data,|
|00002100| 20 45 4c 46 4d 41 47 2c | 20 53 45 4c 46 4d 41 47 | ELFMAG,| SELFMAG|
|00002110| 29 29 20 7b 0a 09 65 6c | 66 2d 3e 65 5f 6b 69 6e |)) {..el|f->e_kin|
|00002120| 64 20 3d 20 45 4c 46 5f | 4b 5f 45 4c 46 3b 0a 09 |d = ELF_|K_ELF;..|
|00002130| 65 6c 66 2d 3e 65 5f 69 | 64 6c 65 6e 20 3d 20 45 |elf->e_i|dlen = E|
|00002140| 49 5f 4e 49 44 45 4e 54 | 3b 0a 09 65 6c 66 2d 3e |I_NIDENT|;..elf->|
|00002150| 65 5f 63 6c 61 73 73 20 | 3d 20 65 6c 66 2d 3e 65 |e_class |= elf->e|
|00002160| 5f 64 61 74 61 5b 45 49 | 5f 43 4c 41 53 53 5d 3b |_data[EI|_CLASS];|
|00002170| 0a 09 65 6c 66 2d 3e 65 | 5f 65 6e 63 6f 64 69 6e |..elf->e|_encodin|
|00002180| 67 20 3d 20 65 6c 66 2d | 3e 65 5f 64 61 74 61 5b |g = elf-|>e_data[|
|00002190| 45 49 5f 44 41 54 41 5d | 3b 0a 09 65 6c 66 2d 3e |EI_DATA]|;..elf->|
|000021a0| 65 5f 76 65 72 73 69 6f | 6e 20 3d 20 65 6c 66 2d |e_versio|n = elf-|
|000021b0| 3e 65 5f 64 61 74 61 5b | 45 49 5f 56 45 52 53 49 |>e_data[|EI_VERSI|
|000021c0| 4f 4e 5d 3b 0a 20 20 20 | 20 7d 0a 20 20 20 20 65 |ON];. | }. e|
|000021d0| 6c 73 65 20 69 66 20 28 | 73 69 7a 65 20 3e 3d 20 |lse if (|size >= |
|000021e0| 53 41 52 4d 41 47 20 26 | 26 20 21 6d 65 6d 63 6d |SARMAG &|& !memcm|
|000021f0| 70 28 65 6c 66 2d 3e 65 | 5f 64 61 74 61 2c 20 41 |p(elf->e|_data, A|
|00002200| 52 4d 41 47 2c 20 53 41 | 52 4d 41 47 29 29 20 7b |RMAG, SA|RMAG)) {|
|00002210| 0a 09 5f 65 6c 66 5f 69 | 6e 69 74 5f 61 72 28 65 |.._elf_i|nit_ar(e|
|00002220| 6c 66 29 3b 0a 20 20 20 | 20 7d 0a 0a 20 20 20 20 |lf);. | }.. |
|00002230| 72 65 74 75 72 6e 20 65 | 6c 66 3b 0a 7d 0a 00 00 |return e|lf;.}...|
|00002240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002280| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002290| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000022a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000022b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000022c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000022d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000022e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000022f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002400| 6c 69 62 65 6c 66 2d 30 | 2e 35 2e 32 2f 63 6e 74 |libelf-0|.5.2/cnt|
|00002410| 6c 2e 63 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |l.c.....|........|
|00002420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002460| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 20 31 |....1006|44 . 1|
|00002470| 34 34 20 00 20 20 20 20 | 32 34 20 00 20 20 20 20 |44 . |24 . |
|00002480| 20 20 20 33 33 35 31 20 | 20 36 30 34 31 35 31 33 | 3351 | 6041513|
|00002490| 37 36 30 20 20 31 33 30 | 30 30 00 20 30 00 00 00 |760 130|00. 0...|
|000024a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000024b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000024c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000024d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000024e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000024f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002500| 00 75 73 74 61 72 20 20 | 00 6d 69 63 68 61 65 6c |.ustar |.michael|
|00002510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002520| 00 00 00 00 00 00 00 00 | 00 73 74 61 66 66 00 00 |........|.staff..|
|00002530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002580| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002600| 2f 2a 0a 63 6e 74 6c 2e | 63 20 2d 20 69 6d 70 6c |/*.cntl.|c - impl|
|00002610| 65 6d 65 6e 74 61 74 69 | 6f 6e 20 6f 66 20 74 68 |ementati|on of th|
|00002620| 65 20 65 6c 66 5f 63 6e | 74 6c 28 33 29 20 66 75 |e elf_cn|tl(3) fu|
|00002630| 6e 63 74 69 6f 6e 2e 0a | 43 6f 70 79 72 69 67 68 |nction..|Copyrigh|
|00002640| 74 20 28 43 29 20 31 39 | 39 35 20 4d 69 63 68 61 |t (C) 19|95 Micha|
|00002650| 65 6c 20 52 69 65 70 65 | 20 3c 72 69 65 70 65 40 |el Riepe| <riepe@|
|00002660| 69 66 77 73 6e 34 2e 69 | 66 77 2e 75 6e 69 2d 68 |ifwsn4.i|fw.uni-h|
|00002670| 61 6e 6e 6f 76 65 72 2e | 64 65 3e 0a 0a 54 68 69 |annover.|de>..Thi|
|00002680| 73 20 6c 69 62 72 61 72 | 79 20 69 73 20 66 72 65 |s librar|y is fre|
|00002690| 65 20 73 6f 66 74 77 61 | 72 65 3b 20 79 6f 75 20 |e softwa|re; you |
|000026a0| 63 61 6e 20 72 65 64 69 | 73 74 72 69 62 75 74 65 |can redi|stribute|
|000026b0| 20 69 74 20 61 6e 64 2f | 6f 72 0a 6d 6f 64 69 66 | it and/|or.modif|
|000026c0| 79 20 69 74 20 75 6e 64 | 65 72 20 74 68 65 20 74 |y it und|er the t|
|000026d0| 65 72 6d 73 20 6f 66 20 | 74 68 65 20 47 4e 55 20 |erms of |the GNU |
|000026e0| 4c 69 62 72 61 72 79 20 | 47 65 6e 65 72 61 6c 20 |Library |General |
|000026f0| 50 75 62 6c 69 63 0a 4c | 69 63 65 6e 73 65 20 61 |Public.L|icense a|
|00002700| 73 20 70 75 62 6c 69 73 | 68 65 64 20 62 79 20 74 |s publis|hed by t|
|00002710| 68 65 20 46 72 65 65 20 | 53 6f 66 74 77 61 72 65 |he Free |Software|
|00002720| 20 46 6f 75 6e 64 61 74 | 69 6f 6e 3b 20 65 69 74 | Foundat|ion; eit|
|00002730| 68 65 72 0a 76 65 72 73 | 69 6f 6e 20 32 20 6f 66 |her.vers|ion 2 of|
|00002740| 20 74 68 65 20 4c 69 63 | 65 6e 73 65 2c 20 6f 72 | the Lic|ense, or|
|00002750| 20 28 61 74 20 79 6f 75 | 72 20 6f 70 74 69 6f 6e | (at you|r option|
|00002760| 29 20 61 6e 79 20 6c 61 | 74 65 72 20 76 65 72 73 |) any la|ter vers|
|00002770| 69 6f 6e 2e 0a 0a 54 68 | 69 73 20 6c 69 62 72 61 |ion...Th|is libra|
|00002780| 72 79 20 69 73 20 64 69 | 73 74 72 69 62 75 74 65 |ry is di|stribute|
|00002790| 64 20 69 6e 20 74 68 65 | 20 68 6f 70 65 20 74 68 |d in the| hope th|
|000027a0| 61 74 20 69 74 20 77 69 | 6c 6c 20 62 65 20 75 73 |at it wi|ll be us|
|000027b0| 65 66 75 6c 2c 0a 62 75 | 74 20 57 49 54 48 4f 55 |eful,.bu|t WITHOU|
|000027c0| 54 20 41 4e 59 20 57 41 | 52 52 41 4e 54 59 3b 20 |T ANY WA|RRANTY; |
|000027d0| 77 69 74 68 6f 75 74 20 | 65 76 65 6e 20 74 68 65 |without |even the|
|000027e0| 20 69 6d 70 6c 69 65 64 | 20 77 61 72 72 61 6e 74 | implied| warrant|
|000027f0| 79 20 6f 66 0a 4d 45 52 | 43 48 41 4e 54 41 42 49 |y of.MER|CHANTABI|
|00002800| 4c 49 54 59 20 6f 72 20 | 46 49 54 4e 45 53 53 20 |LITY or |FITNESS |
|00002810| 46 4f 52 20 41 20 50 41 | 52 54 49 43 55 4c 41 52 |FOR A PA|RTICULAR|
|00002820| 20 50 55 52 50 4f 53 45 | 2e 20 20 53 65 65 20 74 | PURPOSE|. See t|
|00002830| 68 65 20 47 4e 55 0a 4c | 69 62 72 61 72 79 20 47 |he GNU.L|ibrary G|
|00002840| 65 6e 65 72 61 6c 20 50 | 75 62 6c 69 63 20 4c 69 |eneral P|ublic Li|
|00002850| 63 65 6e 73 65 20 66 6f | 72 20 6d 6f 72 65 20 64 |cense fo|r more d|
|00002860| 65 74 61 69 6c 73 2e 0a | 0a 59 6f 75 20 73 68 6f |etails..|.You sho|
|00002870| 75 6c 64 20 68 61 76 65 | 20 72 65 63 65 69 76 65 |uld have| receive|
|00002880| 64 20 61 20 63 6f 70 79 | 20 6f 66 20 74 68 65 20 |d a copy| of the |
|00002890| 47 4e 55 20 4c 69 62 72 | 61 72 79 20 47 65 6e 65 |GNU Libr|ary Gene|
|000028a0| 72 61 6c 20 50 75 62 6c | 69 63 0a 4c 69 63 65 6e |ral Publ|ic.Licen|
|000028b0| 73 65 20 61 6c 6f 6e 67 | 20 77 69 74 68 20 74 68 |se along| with th|
|000028c0| 69 73 20 6c 69 62 72 61 | 72 79 3b 20 69 66 20 6e |is libra|ry; if n|
|000028d0| 6f 74 2c 20 77 72 69 74 | 65 20 74 6f 20 74 68 65 |ot, writ|e to the|
|000028e0| 20 46 72 65 65 20 53 6f | 66 74 77 61 72 65 0a 46 | Free So|ftware.F|
|000028f0| 6f 75 6e 64 61 74 69 6f | 6e 2c 20 49 6e 63 2e 2c |oundatio|n, Inc.,|
|00002900| 20 35 39 20 54 65 6d 70 | 6c 65 20 50 6c 61 63 65 | 59 Temp|le Place|
|00002910| 20 2d 20 53 75 69 74 65 | 20 33 33 30 2c 20 42 6f | - Suite| 330, Bo|
|00002920| 73 74 6f 6e 2c 20 4d 41 | 20 30 32 31 31 31 2d 31 |ston, MA| 02111-1|
|00002930| 33 30 37 2c 20 55 53 41 | 2e 0a 2a 2f 0a 0a 23 69 |307, USA|..*/..#i|
|00002940| 6e 63 6c 75 64 65 20 3c | 70 72 69 76 61 74 65 2e |nclude <|private.|
|00002950| 68 3e 0a 0a 69 6e 74 0a | 65 6c 66 5f 63 6e 74 6c |h>..int.|elf_cntl|
|00002960| 28 45 6c 66 20 2a 65 6c | 66 2c 20 45 6c 66 5f 43 |(Elf *el|f, Elf_C|
|00002970| 6d 64 20 63 6d 64 29 20 | 7b 0a 20 20 20 20 45 6c |md cmd) |{. El|
|00002980| 66 5f 53 63 6e 20 2a 73 | 63 6e 3b 0a 20 20 20 20 |f_Scn *s|cn;. |
|00002990| 45 6c 66 20 2a 63 68 69 | 6c 64 3b 0a 0a 20 20 20 |Elf *chi|ld;.. |
|000029a0| 20 69 66 20 28 21 65 6c | 66 29 20 7b 0a 09 72 65 | if (!el|f) {..re|
|000029b0| 74 75 72 6e 20 2d 31 3b | 0a 20 20 20 20 7d 0a 20 |turn -1;|. }. |
|000029c0| 20 20 20 65 6c 66 5f 61 | 73 73 65 72 74 28 65 6c | elf_a|ssert(el|
|000029d0| 66 2d 3e 65 5f 6d 61 67 | 69 63 20 3d 3d 20 45 4c |f->e_mag|ic == EL|
|000029e0| 46 5f 4d 41 47 49 43 29 | 3b 0a 20 20 20 20 69 66 |F_MAGIC)|;. if|
|000029f0| 20 28 65 6c 66 2d 3e 65 | 5f 64 69 73 61 62 6c 65 | (elf->e|_disable|
|00002a00| 64 29 20 7b 0a 09 72 65 | 74 75 72 6e 20 30 3b 0a |d) {..re|turn 0;.|
|00002a10| 20 20 20 20 7d 0a 20 20 | 20 20 69 66 20 28 63 6d | }. | if (cm|
|00002a20| 64 20 3d 3d 20 45 4c 46 | 5f 43 5f 46 44 52 45 41 |d == ELF|_C_FDREA|
|00002a30| 44 29 20 7b 0a 09 69 66 | 20 28 21 65 6c 66 2d 3e |D) {..if| (!elf->|
|00002a40| 65 5f 72 65 61 64 61 62 | 6c 65 29 20 7b 0a 09 20 |e_readab|le) {.. |
|00002a50| 20 20 20 73 65 74 65 72 | 72 28 45 52 52 4f 52 5f | seter|r(ERROR_|
|00002a60| 57 52 4f 4e 4c 59 29 3b | 0a 09 20 20 20 20 72 65 |WRONLY);|.. re|
|00002a70| 74 75 72 6e 20 2d 31 3b | 0a 09 7d 0a 09 69 66 20 |turn -1;|..}..if |
|00002a80| 28 21 65 6c 66 2d 3e 65 | 5f 73 69 7a 65 29 20 7b |(!elf->e|_size) {|
|00002a90| 0a 09 20 20 20 20 72 65 | 74 75 72 6e 20 30 3b 0a |.. re|turn 0;.|
|00002aa0| 09 7d 0a 09 69 66 20 28 | 21 65 6c 66 2d 3e 65 5f |.}..if (|!elf->e_|
|00002ab0| 65 68 64 72 20 26 26 20 | 21 5f 65 6c 66 5f 63 6f |ehdr && |!_elf_co|
|00002ac0| 6f 6b 28 65 6c 66 29 29 | 20 7b 0a 09 20 20 20 20 |ok(elf))| {.. |
|00002ad0| 72 65 74 75 72 6e 20 2d | 31 3b 0a 09 7d 0a 09 66 |return -|1;..}..f|
|00002ae0| 6f 72 20 28 73 63 6e 20 | 3d 20 65 6c 66 2d 3e 65 |or (scn |= elf->e|
|00002af0| 5f 73 63 6e 5f 31 3b 20 | 73 63 6e 3b 20 73 63 6e |_scn_1; |scn; scn|
|00002b00| 20 3d 20 73 63 6e 2d 3e | 73 5f 6c 69 6e 6b 29 20 | = scn->|s_link) |
|00002b10| 7b 0a 09 20 20 20 20 69 | 66 20 28 73 63 6e 2d 3e |{.. i|f (scn->|
|00002b20| 73 5f 69 6e 64 65 78 20 | 3d 3d 20 53 48 4e 5f 55 |s_index |== SHN_U|
|00002b30| 4e 44 45 46 20 7c 7c 20 | 73 63 6e 2d 3e 73 5f 74 |NDEF || |scn->s_t|
|00002b40| 79 70 65 20 3d 3d 20 53 | 48 54 5f 4e 55 4c 4c 29 |ype == S|HT_NULL)|
|00002b50| 20 7b 0a 09 09 63 6f 6e | 74 69 6e 75 65 3b 0a 09 | {...con|tinue;..|
|00002b60| 20 20 20 20 7d 0a 09 20 | 20 20 20 65 6c 73 65 20 | }.. | else |
|00002b70| 69 66 20 28 21 65 6c 66 | 5f 67 65 74 64 61 74 61 |if (!elf|_getdata|
|00002b80| 28 73 63 6e 2c 20 4e 55 | 4c 4c 29 29 20 7b 0a 09 |(scn, NU|LL)) {..|
|00002b90| 09 72 65 74 75 72 6e 20 | 2d 31 3b 0a 09 20 20 20 |.return |-1;.. |
|00002ba0| 20 7d 0a 09 7d 0a 20 20 | 20 20 7d 0a 20 20 20 20 | }..}. | }. |
|00002bb0| 65 6c 73 65 20 69 66 20 | 28 63 6d 64 20 21 3d 20 |else if |(cmd != |
|00002bc0| 45 4c 46 5f 43 5f 46 44 | 44 4f 4e 45 29 20 7b 0a |ELF_C_FD|DONE) {.|
|00002bd0| 09 73 65 74 65 72 72 28 | 45 52 52 4f 52 5f 49 4e |.seterr(|ERROR_IN|
|00002be0| 56 41 4c 49 44 5f 43 4d | 44 29 3b 0a 09 72 65 74 |VALID_CM|D);..ret|
|00002bf0| 75 72 6e 20 2d 31 3b 0a | 20 20 20 20 7d 0a 20 20 |urn -1;.| }. |
|00002c00| 20 20 65 6c 66 2d 3e 65 | 5f 64 69 73 61 62 6c 65 | elf->e|_disable|
|00002c10| 64 20 3d 20 31 3b 0a 20 | 20 20 20 66 6f 72 20 28 |d = 1;. | for (|
|00002c20| 63 68 69 6c 64 20 3d 20 | 65 6c 66 2d 3e 65 5f 6d |child = |elf->e_m|
|00002c30| 65 6d 62 65 72 73 3b 20 | 63 68 69 6c 64 3b 20 63 |embers; |child; c|
|00002c40| 68 69 6c 64 20 3d 20 63 | 68 69 6c 64 2d 3e 65 5f |hild = c|hild->e_|
|00002c50| 6c 69 6e 6b 29 20 7b 0a | 09 65 6c 66 5f 61 73 73 |link) {.|.elf_ass|
|00002c60| 65 72 74 28 65 6c 66 2d | 3e 65 5f 6b 69 6e 64 20 |ert(elf-|>e_kind |
|00002c70| 3d 3d 20 45 4c 46 5f 4b | 5f 41 52 29 3b 0a 09 65 |== ELF_K|_AR);..e|
|00002c80| 6c 66 5f 61 73 73 65 72 | 74 28 65 6c 66 20 3d 3d |lf_asser|t(elf ==|
|00002c90| 20 63 68 69 6c 64 2d 3e | 65 5f 70 61 72 65 6e 74 | child->|e_parent|
|00002ca0| 29 3b 0a 09 69 66 20 28 | 65 6c 66 5f 63 6e 74 6c |);..if (|elf_cntl|
|00002cb0| 28 63 68 69 6c 64 2c 20 | 63 6d 64 29 29 20 7b 0a |(child, |cmd)) {.|
|00002cc0| 09 20 20 20 20 72 65 74 | 75 72 6e 20 2d 31 3b 0a |. ret|urn -1;.|
|00002cd0| 09 7d 0a 20 20 20 20 7d | 0a 20 20 20 20 72 65 74 |.}. }|. ret|
|00002ce0| 75 72 6e 20 30 3b 0a 7d | 0a 00 00 00 00 00 00 00 |urn 0;.}|........|
|00002cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e00| 6c 69 62 65 6c 66 2d 30 | 2e 35 2e 32 2f 65 6e 64 |libelf-0|.5.2/end|
|00002e10| 2e 63 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.c......|........|
|00002e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e60| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 20 31 |....1006|44 . 1|
|00002e70| 34 34 20 00 20 20 20 20 | 32 34 20 00 20 20 20 20 |44 . |24 . |
|00002e80| 20 20 20 34 37 33 32 20 | 20 36 30 34 31 35 31 33 | 4732 | 6041513|
|00002e90| 37 36 30 20 20 31 32 36 | 31 32 00 20 30 00 00 00 |760 126|12. 0...|
|00002ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f00| 00 75 73 74 61 72 20 20 | 00 6d 69 63 68 61 65 6c |.ustar |.michael|
|00002f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f20| 00 00 00 00 00 00 00 00 | 00 73 74 61 66 66 00 00 |........|.staff..|
|00002f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003000| 2f 2a 0a 65 6e 64 2e 63 | 20 2d 20 69 6d 70 6c 65 |/*.end.c| - imple|
|00003010| 6d 65 6e 74 61 74 69 6f | 6e 20 6f 66 20 74 68 65 |mentatio|n of the|
|00003020| 20 65 6c 66 5f 65 6e 64 | 28 33 29 20 66 75 6e 63 | elf_end|(3) func|
|00003030| 74 69 6f 6e 2e 0a 43 6f | 70 79 72 69 67 68 74 20 |tion..Co|pyright |
|00003040| 28 43 29 20 31 39 39 35 | 20 4d 69 63 68 61 65 6c |(C) 1995| Michael|
|00003050| 20 52 69 65 70 65 20 3c | 72 69 65 70 65 40 69 66 | Riepe <|riepe@if|
|00003060| 77 73 6e 34 2e 69 66 77 | 2e 75 6e 69 2d 68 61 6e |wsn4.ifw|.uni-han|
|00003070| 6e 6f 76 65 72 2e 64 65 | 3e 0a 0a 54 68 69 73 20 |nover.de|>..This |
|00003080| 6c 69 62 72 61 72 79 20 | 69 73 20 66 72 65 65 20 |library |is free |
|00003090| 73 6f 66 74 77 61 72 65 | 3b 20 79 6f 75 20 63 61 |software|; you ca|
|000030a0| 6e 20 72 65 64 69 73 74 | 72 69 62 75 74 65 20 69 |n redist|ribute i|
|000030b0| 74 20 61 6e 64 2f 6f 72 | 0a 6d 6f 64 69 66 79 20 |t and/or|.modify |
|000030c0| 69 74 20 75 6e 64 65 72 | 20 74 68 65 20 74 65 72 |it under| the ter|
|000030d0| 6d 73 20 6f 66 20 74 68 | 65 20 47 4e 55 20 4c 69 |ms of th|e GNU Li|
|000030e0| 62 72 61 72 79 20 47 65 | 6e 65 72 61 6c 20 50 75 |brary Ge|neral Pu|
|000030f0| 62 6c 69 63 0a 4c 69 63 | 65 6e 73 65 20 61 73 20 |blic.Lic|ense as |
|00003100| 70 75 62 6c 69 73 68 65 | 64 20 62 79 20 74 68 65 |publishe|d by the|
|00003110| 20 46 72 65 65 20 53 6f | 66 74 77 61 72 65 20 46 | Free So|ftware F|
|00003120| 6f 75 6e 64 61 74 69 6f | 6e 3b 20 65 69 74 68 65 |oundatio|n; eithe|
|00003130| 72 0a 76 65 72 73 69 6f | 6e 20 32 20 6f 66 20 74 |r.versio|n 2 of t|
|00003140| 68 65 20 4c 69 63 65 6e | 73 65 2c 20 6f 72 20 28 |he Licen|se, or (|
|00003150| 61 74 20 79 6f 75 72 20 | 6f 70 74 69 6f 6e 29 20 |at your |option) |
|00003160| 61 6e 79 20 6c 61 74 65 | 72 20 76 65 72 73 69 6f |any late|r versio|
|00003170| 6e 2e 0a 0a 54 68 69 73 | 20 6c 69 62 72 61 72 79 |n...This| library|
|00003180| 20 69 73 20 64 69 73 74 | 72 69 62 75 74 65 64 20 | is dist|ributed |
|00003190| 69 6e 20 74 68 65 20 68 | 6f 70 65 20 74 68 61 74 |in the h|ope that|
|000031a0| 20 69 74 20 77 69 6c 6c | 20 62 65 20 75 73 65 66 | it will| be usef|
|000031b0| 75 6c 2c 0a 62 75 74 20 | 57 49 54 48 4f 55 54 20 |ul,.but |WITHOUT |
|000031c0| 41 4e 59 20 57 41 52 52 | 41 4e 54 59 3b 20 77 69 |ANY WARR|ANTY; wi|
|000031d0| 74 68 6f 75 74 20 65 76 | 65 6e 20 74 68 65 20 69 |thout ev|en the i|
|000031e0| 6d 70 6c 69 65 64 20 77 | 61 72 72 61 6e 74 79 20 |mplied w|arranty |
|000031f0| 6f 66 0a 4d 45 52 43 48 | 41 4e 54 41 42 49 4c 49 |of.MERCH|ANTABILI|
|00003200| 54 59 20 6f 72 20 46 49 | 54 4e 45 53 53 20 46 4f |TY or FI|TNESS FO|
|00003210| 52 20 41 20 50 41 52 54 | 49 43 55 4c 41 52 20 50 |R A PART|ICULAR P|
|00003220| 55 52 50 4f 53 45 2e 20 | 20 53 65 65 20 74 68 65 |URPOSE. | See the|
|00003230| 20 47 4e 55 0a 4c 69 62 | 72 61 72 79 20 47 65 6e | GNU.Lib|rary Gen|
|00003240| 65 72 61 6c 20 50 75 62 | 6c 69 63 20 4c 69 63 65 |eral Pub|lic Lice|
|00003250| 6e 73 65 20 66 6f 72 20 | 6d 6f 72 65 20 64 65 74 |nse for |more det|
|00003260| 61 69 6c 73 2e 0a 0a 59 | 6f 75 20 73 68 6f 75 6c |ails...Y|ou shoul|
|00003270| 64 20 68 61 76 65 20 72 | 65 63 65 69 76 65 64 20 |d have r|eceived |
|00003280| 61 20 63 6f 70 79 20 6f | 66 20 74 68 65 20 47 4e |a copy o|f the GN|
|00003290| 55 20 4c 69 62 72 61 72 | 79 20 47 65 6e 65 72 61 |U Librar|y Genera|
|000032a0| 6c 20 50 75 62 6c 69 63 | 0a 4c 69 63 65 6e 73 65 |l Public|.License|
|000032b0| 20 61 6c 6f 6e 67 20 77 | 69 74 68 20 74 68 69 73 | along w|ith this|
|000032c0| 20 6c 69 62 72 61 72 79 | 3b 20 69 66 20 6e 6f 74 | library|; if not|
|000032d0| 2c 20 77 72 69 74 65 20 | 74 6f 20 74 68 65 20 46 |, write |to the F|
|000032e0| 72 65 65 20 53 6f 66 74 | 77 61 72 65 0a 46 6f 75 |ree Soft|ware.Fou|
|000032f0| 6e 64 61 74 69 6f 6e 2c | 20 49 6e 63 2e 2c 20 35 |ndation,| Inc., 5|
|00003300| 39 20 54 65 6d 70 6c 65 | 20 50 6c 61 63 65 20 2d |9 Temple| Place -|
|00003310| 20 53 75 69 74 65 20 33 | 33 30 2c 20 42 6f 73 74 | Suite 3|30, Bost|
|00003320| 6f 6e 2c 20 4d 41 20 30 | 32 31 31 31 2d 31 33 30 |on, MA 0|2111-130|
|00003330| 37 2c 20 55 53 41 2e 0a | 2a 2f 0a 0a 23 69 6e 63 |7, USA..|*/..#inc|
|00003340| 6c 75 64 65 20 3c 70 72 | 69 76 61 74 65 2e 68 3e |lude <pr|ivate.h>|
|00003350| 0a 0a 73 74 61 74 69 63 | 20 76 6f 69 64 0a 5f 65 |..static| void._e|
|00003360| 6c 66 5f 66 72 65 65 28 | 76 6f 69 64 20 2a 70 74 |lf_free(|void *pt|
|00003370| 72 29 20 7b 0a 20 20 20 | 20 69 66 20 28 70 74 72 |r) {. | if (ptr|
|00003380| 29 20 7b 0a 09 66 72 65 | 65 28 70 74 72 29 3b 0a |) {..fre|e(ptr);.|
|00003390| 20 20 20 20 7d 0a 7d 0a | 0a 73 74 61 74 69 63 20 | }.}.|.static |
|000033a0| 76 6f 69 64 0a 5f 65 6c | 66 5f 66 72 65 65 5f 73 |void._el|f_free_s|
|000033b0| 63 6e 73 28 45 6c 66 20 | 2a 65 6c 66 2c 20 45 6c |cns(Elf |*elf, El|
|000033c0| 66 5f 53 63 6e 20 2a 73 | 63 6e 29 20 7b 0a 20 20 |f_Scn *s|cn) {. |
|000033d0| 20 20 53 63 6e 5f 44 61 | 74 61 20 2a 73 64 2c 20 | Scn_Da|ta *sd, |
|000033e0| 2a 74 6d 70 3b 0a 20 20 | 20 20 45 6c 66 5f 53 63 |*tmp;. | Elf_Sc|
|000033f0| 6e 20 2a 66 72 65 65 73 | 63 6e 3b 0a 0a 20 20 20 |n *frees|cn;.. |
|00003400| 20 66 6f 72 20 28 66 72 | 65 65 73 63 6e 20 3d 20 | for (fr|eescn = |
|00003410| 4e 55 4c 4c 3b 20 73 63 | 6e 3b 20 73 63 6e 20 3d |NULL; sc|n; scn =|
|00003420| 20 73 63 6e 2d 3e 73 5f | 6c 69 6e 6b 29 20 7b 0a | scn->s_|link) {.|
|00003430| 09 65 6c 66 5f 61 73 73 | 65 72 74 28 73 63 6e 2d |.elf_ass|ert(scn-|
|00003440| 3e 73 5f 6d 61 67 69 63 | 20 3d 3d 20 53 43 4e 5f |>s_magic| == SCN_|
|00003450| 4d 41 47 49 43 29 3b 0a | 09 65 6c 66 5f 61 73 73 |MAGIC);.|.elf_ass|
|00003460| 65 72 74 28 73 63 6e 2d | 3e 73 5f 65 6c 66 20 3d |ert(scn-|>s_elf =|
|00003470| 3d 20 65 6c 66 29 3b 0a | 09 66 6f 72 20 28 73 64 |= elf);.|.for (sd|
|00003480| 20 3d 20 73 63 6e 2d 3e | 73 5f 64 61 74 61 5f 31 | = scn->|s_data_1|
|00003490| 3b 20 73 64 3b 20 73 64 | 20 3d 20 74 6d 70 29 20 |; sd; sd| = tmp) |
|000034a0| 7b 0a 09 20 20 20 20 74 | 6d 70 20 3d 20 73 64 2d |{.. t|mp = sd-|
|000034b0| 3e 73 64 5f 6c 69 6e 6b | 3b 0a 09 20 20 20 20 69 |>sd_link|;.. i|
|000034c0| 66 20 28 73 64 2d 3e 73 | 64 5f 66 72 65 65 5f 64 |f (sd->s|d_free_d|
|000034d0| 61 74 61 29 20 7b 0a 09 | 09 5f 65 6c 66 5f 66 72 |ata) {..|._elf_fr|
|000034e0| 65 65 28 73 64 2d 3e 73 | 64 5f 6d 65 6d 64 61 74 |ee(sd->s|d_memdat|
|000034f0| 61 29 3b 0a 09 20 20 20 | 20 7d 0a 09 20 20 20 20 |a);.. | }.. |
|00003500| 69 66 20 28 73 64 2d 3e | 73 64 5f 66 72 65 65 6d |if (sd->|sd_freem|
|00003510| 65 29 20 7b 0a 09 09 66 | 72 65 65 28 73 64 29 3b |e) {...f|ree(sd);|
|00003520| 0a 09 20 20 20 20 7d 0a | 09 7d 0a 09 69 66 20 28 |.. }.|.}..if (|
|00003530| 28 73 64 20 3d 20 73 63 | 6e 2d 3e 73 5f 72 61 77 |(sd = sc|n->s_raw|
|00003540| 64 61 74 61 29 29 20 7b | 0a 09 20 20 20 20 69 66 |data)) {|.. if|
|00003550| 20 28 73 64 2d 3e 73 64 | 5f 66 72 65 65 5f 64 61 | (sd->sd|_free_da|
|00003560| 74 61 29 20 7b 0a 09 09 | 5f 65 6c 66 5f 66 72 65 |ta) {...|_elf_fre|
|00003570| 65 28 73 64 2d 3e 73 64 | 5f 6d 65 6d 64 61 74 61 |e(sd->sd|_memdata|
|00003580| 29 3b 0a 09 20 20 20 20 | 7d 0a 09 20 20 20 20 69 |);.. |}.. i|
|00003590| 66 20 28 73 64 2d 3e 73 | 64 5f 66 72 65 65 6d 65 |f (sd->s|d_freeme|
|000035a0| 29 20 7b 0a 09 09 66 72 | 65 65 28 73 64 29 3b 0a |) {...fr|ee(sd);.|
|000035b0| 09 20 20 20 20 7d 0a 09 | 7d 0a 09 69 66 20 28 73 |. }..|}..if (s|
|000035c0| 63 6e 2d 3e 73 5f 66 72 | 65 65 6d 65 29 20 7b 0a |cn->s_fr|eeme) {.|
|000035d0| 09 20 20 20 20 5f 65 6c | 66 5f 66 72 65 65 28 66 |. _el|f_free(f|
|000035e0| 72 65 65 73 63 6e 29 3b | 0a 09 20 20 20 20 66 72 |reescn);|.. fr|
|000035f0| 65 65 73 63 6e 20 3d 20 | 73 63 6e 3b 0a 09 7d 0a |eescn = |scn;..}.|
|00003600| 20 20 20 20 7d 0a 20 20 | 20 20 5f 65 6c 66 5f 66 | }. | _elf_f|
|00003610| 72 65 65 28 66 72 65 65 | 73 63 6e 29 3b 0a 7d 0a |ree(free|scn);.}.|
|00003620| 0a 69 6e 74 0a 65 6c 66 | 5f 65 6e 64 28 45 6c 66 |.int.elf|_end(Elf|
|00003630| 20 2a 65 6c 66 29 20 7b | 0a 20 20 20 20 45 6c 66 | *elf) {|. Elf|
|00003640| 20 2a 2a 73 69 62 6c 69 | 6e 67 73 3b 0a 0a 20 20 | **sibli|ngs;.. |
|00003650| 20 20 69 66 20 28 21 65 | 6c 66 29 20 7b 0a 09 72 | if (!e|lf) {..r|
|00003660| 65 74 75 72 6e 20 30 3b | 0a 20 20 20 20 7d 0a 20 |eturn 0;|. }. |
|00003670| 20 20 20 65 6c 66 5f 61 | 73 73 65 72 74 28 65 6c | elf_a|ssert(el|
|00003680| 66 2d 3e 65 5f 6d 61 67 | 69 63 20 3d 3d 20 45 4c |f->e_mag|ic == EL|
|00003690| 46 5f 4d 41 47 49 43 29 | 3b 0a 20 20 20 20 69 66 |F_MAGIC)|;. if|
|000036a0| 20 28 2d 2d 65 6c 66 2d | 3e 65 5f 63 6f 75 6e 74 | (--elf-|>e_count|
|000036b0| 29 20 7b 0a 09 72 65 74 | 75 72 6e 20 65 6c 66 2d |) {..ret|urn elf-|
|000036c0| 3e 65 5f 63 6f 75 6e 74 | 3b 0a 20 20 20 20 7d 0a |>e_count|;. }.|
|000036d0| 20 20 20 20 69 66 20 28 | 65 6c 66 2d 3e 65 5f 70 | if (|elf->e_p|
|000036e0| 61 72 65 6e 74 29 20 7b | 0a 09 65 6c 66 5f 61 73 |arent) {|..elf_as|
|000036f0| 73 65 72 74 28 65 6c 66 | 2d 3e 65 5f 70 61 72 65 |sert(elf|->e_pare|
|00003700| 6e 74 2d 3e 65 5f 6d 61 | 67 69 63 20 3d 3d 20 45 |nt->e_ma|gic == E|
|00003710| 4c 46 5f 4d 41 47 49 43 | 29 3b 0a 09 65 6c 66 5f |LF_MAGIC|);..elf_|
|00003720| 61 73 73 65 72 74 28 65 | 6c 66 2d 3e 65 5f 70 61 |assert(e|lf->e_pa|
|00003730| 72 65 6e 74 2d 3e 65 5f | 6b 69 6e 64 20 3d 3d 20 |rent->e_|kind == |
|00003740| 45 4c 46 5f 4b 5f 41 52 | 29 3b 0a 09 73 69 62 6c |ELF_K_AR|);..sibl|
|00003750| 69 6e 67 73 20 3d 20 26 | 65 6c 66 2d 3e 65 5f 70 |ings = &|elf->e_p|
|00003760| 61 72 65 6e 74 2d 3e 65 | 5f 6d 65 6d 62 65 72 73 |arent->e|_members|
|00003770| 3b 0a 09 77 68 69 6c 65 | 20 28 2a 73 69 62 6c 69 |;..while| (*sibli|
|00003780| 6e 67 73 29 20 7b 0a 09 | 20 20 20 20 69 66 20 28 |ngs) {..| if (|
|00003790| 2a 73 69 62 6c 69 6e 67 | 73 20 3d 3d 20 65 6c 66 |*sibling|s == elf|
|000037a0| 29 20 7b 0a 09 09 2a 73 | 69 62 6c 69 6e 67 73 20 |) {...*s|iblings |
|000037b0| 3d 20 65 6c 66 2d 3e 65 | 5f 6c 69 6e 6b 3b 0a 09 |= elf->e|_link;..|
|000037c0| 09 62 72 65 61 6b 3b 0a | 09 20 20 20 20 7d 0a 09 |.break;.|. }..|
|000037d0| 20 20 20 20 73 69 62 6c | 69 6e 67 73 20 3d 20 26 | sibl|ings = &|
|000037e0| 28 2a 73 69 62 6c 69 6e | 67 73 29 2d 3e 65 5f 6c |(*siblin|gs)->e_l|
|000037f0| 69 6e 6b 3b 0a 09 7d 0a | 09 65 6c 66 5f 65 6e 64 |ink;..}.|.elf_end|
|00003800| 28 65 6c 66 2d 3e 65 5f | 70 61 72 65 6e 74 29 3b |(elf->e_|parent);|
|00003810| 0a 09 5f 65 6c 66 5f 66 | 72 65 65 28 65 6c 66 2d |.._elf_f|ree(elf-|
|00003820| 3e 65 5f 61 72 68 64 72 | 29 3b 0a 20 20 20 20 7d |>e_arhdr|);. }|
|00003830| 0a 20 20 20 20 65 6c 73 | 65 20 7b 0a 09 5f 65 6c |. els|e {.._el|
|00003840| 66 5f 66 72 65 65 28 65 | 6c 66 2d 3e 65 5f 64 61 |f_free(e|lf->e_da|
|00003850| 74 61 29 3b 0a 20 20 20 | 20 7d 0a 20 20 20 20 5f |ta);. | }. _|
|00003860| 65 6c 66 5f 66 72 65 65 | 5f 73 63 6e 73 28 65 6c |elf_free|_scns(el|
|00003870| 66 2c 20 65 6c 66 2d 3e | 65 5f 73 63 6e 5f 31 29 |f, elf->|e_scn_1)|
|00003880| 3b 0a 20 20 20 20 69 66 | 20 28 65 6c 66 2d 3e 65 |;. if| (elf->e|
|00003890| 5f 72 61 77 64 61 74 61 | 20 21 3d 20 65 6c 66 2d |_rawdata| != elf-|
|000038a0| 3e 65 5f 64 61 74 61 29 | 20 7b 0a 09 5f 65 6c 66 |>e_data)| {.._elf|
|000038b0| 5f 66 72 65 65 28 65 6c | 66 2d 3e 65 5f 72 61 77 |_free(el|f->e_raw|
|000038c0| 64 61 74 61 29 3b 0a 20 | 20 20 20 7d 0a 20 20 20 |data);. | }. |
|000038d0| 20 69 66 20 28 65 6c 66 | 2d 3e 65 5f 66 72 65 65 | if (elf|->e_free|
|000038e0| 5f 73 79 6d 73 29 20 7b | 0a 09 5f 65 6c 66 5f 66 |_syms) {|.._elf_f|
|000038f0| 72 65 65 28 65 6c 66 2d | 3e 65 5f 73 79 6d 74 61 |ree(elf-|>e_symta|
|00003900| 62 29 3b 0a 20 20 20 20 | 7d 0a 20 20 20 20 69 66 |b);. |}. if|
|00003910| 20 28 65 6c 66 2d 3e 65 | 5f 66 72 65 65 5f 65 68 | (elf->e|_free_eh|
|00003920| 64 72 29 20 7b 0a 09 5f | 65 6c 66 5f 66 72 65 65 |dr) {.._|elf_free|
|00003930| 28 65 6c 66 2d 3e 65 5f | 65 68 64 72 29 3b 0a 20 |(elf->e_|ehdr);. |
|00003940| 20 20 20 7d 0a 20 20 20 | 20 69 66 20 28 65 6c 66 | }. | if (elf|
|00003950| 2d 3e 65 5f 66 72 65 65 | 5f 70 68 64 72 29 20 7b |->e_free|_phdr) {|
|00003960| 0a 09 5f 65 6c 66 5f 66 | 72 65 65 28 65 6c 66 2d |.._elf_f|ree(elf-|
|00003970| 3e 65 5f 70 68 64 72 29 | 3b 0a 20 20 20 20 7d 0a |>e_phdr)|;. }.|
|00003980| 20 20 20 20 69 66 20 28 | 65 6c 66 2d 3e 65 5f 66 | if (|elf->e_f|
|00003990| 72 65 65 5f 73 68 64 72 | 29 20 7b 0a 09 5f 65 6c |ree_shdr|) {.._el|
|000039a0| 66 5f 66 72 65 65 28 65 | 6c 66 2d 3e 65 5f 73 68 |f_free(e|lf->e_sh|
|000039b0| 64 72 29 3b 0a 20 20 20 | 20 7d 0a 20 20 20 20 66 |dr);. | }. f|
|000039c0| 72 65 65 28 65 6c 66 29 | 3b 0a 20 20 20 20 72 65 |ree(elf)|;. re|
|000039d0| 74 75 72 6e 20 30 3b 0a | 7d 0a 00 00 00 00 00 00 |turn 0;.|}.......|
|000039e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000039f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003a00| 6c 69 62 65 6c 66 2d 30 | 2e 35 2e 32 2f 65 72 72 |libelf-0|.5.2/err|
|00003a10| 6d 73 67 2e 63 00 00 00 | 00 00 00 00 00 00 00 00 |msg.c...|........|
|00003a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003a60| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 20 31 |....1006|44 . 1|
|00003a70| 34 34 20 00 20 20 20 20 | 32 34 20 00 20 20 20 20 |44 . |24 . |
|00003a80| 20 20 20 33 30 36 33 20 | 20 36 30 34 31 35 31 33 | 3063 | 6041513|
|00003a90| 37 36 30 20 20 31 33 33 | 33 37 00 20 30 00 00 00 |760 133|37. 0...|
|00003aa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b00| 00 75 73 74 61 72 20 20 | 00 6d 69 63 68 61 65 6c |.ustar |.michael|
|00003b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b20| 00 00 00 00 00 00 00 00 | 00 73 74 61 66 66 00 00 |........|.staff..|
|00003b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003c00| 2f 2a 0a 65 72 72 6d 73 | 67 2e 63 20 2d 20 69 6d |/*.errms|g.c - im|
|00003c10| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 20 6f 66 20 |plementa|tion of |
|00003c20| 74 68 65 20 65 6c 66 5f | 65 72 72 6d 73 67 28 33 |the elf_|errmsg(3|
|00003c30| 29 20 66 75 6e 63 74 69 | 6f 6e 2e 0a 43 6f 70 79 |) functi|on..Copy|
|00003c40| 72 69 67 68 74 20 28 43 | 29 20 31 39 39 35 20 4d |right (C|) 1995 M|
|00003c50| 69 63 68 61 65 6c 20 52 | 69 65 70 65 20 3c 72 69 |ichael R|iepe <ri|
|00003c60| 65 70 65 40 69 66 77 73 | 6e 34 2e 69 66 77 2e 75 |epe@ifws|n4.ifw.u|
|00003c70| 6e 69 2d 68 61 6e 6e 6f | 76 65 72 2e 64 65 3e 0a |ni-hanno|ver.de>.|
|00003c80| 0a 54 68 69 73 20 6c 69 | 62 72 61 72 79 20 69 73 |.This li|brary is|
|00003c90| 20 66 72 65 65 20 73 6f | 66 74 77 61 72 65 3b 20 | free so|ftware; |
|00003ca0| 79 6f 75 20 63 61 6e 20 | 72 65 64 69 73 74 72 69 |you can |redistri|
|00003cb0| 62 75 74 65 20 69 74 20 | 61 6e 64 2f 6f 72 0a 6d |bute it |and/or.m|
|00003cc0| 6f 64 69 66 79 20 69 74 | 20 75 6e 64 65 72 20 74 |odify it| under t|
|00003cd0| 68 65 20 74 65 72 6d 73 | 20 6f 66 20 74 68 65 20 |he terms| of the |
|00003ce0| 47 4e 55 20 4c 69 62 72 | 61 72 79 20 47 65 6e 65 |GNU Libr|ary Gene|
|00003cf0| 72 61 6c 20 50 75 62 6c | 69 63 0a 4c 69 63 65 6e |ral Publ|ic.Licen|
|00003d00| 73 65 20 61 73 20 70 75 | 62 6c 69 73 68 65 64 20 |se as pu|blished |
|00003d10| 62 79 20 74 68 65 20 46 | 72 65 65 20 53 6f 66 74 |by the F|ree Soft|
|00003d20| 77 61 72 65 20 46 6f 75 | 6e 64 61 74 69 6f 6e 3b |ware Fou|ndation;|
|00003d30| 20 65 69 74 68 65 72 0a | 76 65 72 73 69 6f 6e 20 | either.|version |
|00003d40| 32 20 6f 66 20 74 68 65 | 20 4c 69 63 65 6e 73 65 |2 of the| License|
|00003d50| 2c 20 6f 72 20 28 61 74 | 20 79 6f 75 72 20 6f 70 |, or (at| your op|
|00003d60| 74 69 6f 6e 29 20 61 6e | 79 20 6c 61 74 65 72 20 |tion) an|y later |
|00003d70| 76 65 72 73 69 6f 6e 2e | 0a 0a 54 68 69 73 20 6c |version.|..This l|
|00003d80| 69 62 72 61 72 79 20 69 | 73 20 64 69 73 74 72 69 |ibrary i|s distri|
|00003d90| 62 75 74 65 64 20 69 6e | 20 74 68 65 20 68 6f 70 |buted in| the hop|
|00003da0| 65 20 74 68 61 74 20 69 | 74 20 77 69 6c 6c 20 62 |e that i|t will b|
|00003db0| 65 20 75 73 65 66 75 6c | 2c 0a 62 75 74 20 57 49 |e useful|,.but WI|
|00003dc0| 54 48 4f 55 54 20 41 4e | 59 20 57 41 52 52 41 4e |THOUT AN|Y WARRAN|
|00003dd0| 54 59 3b 20 77 69 74 68 | 6f 75 74 20 65 76 65 6e |TY; with|out even|
|00003de0| 20 74 68 65 20 69 6d 70 | 6c 69 65 64 20 77 61 72 | the imp|lied war|
|00003df0| 72 61 6e 74 79 20 6f 66 | 0a 4d 45 52 43 48 41 4e |ranty of|.MERCHAN|
|00003e00| 54 41 42 49 4c 49 54 59 | 20 6f 72 20 46 49 54 4e |TABILITY| or FITN|
|00003e10| 45 53 53 20 46 4f 52 20 | 41 20 50 41 52 54 49 43 |ESS FOR |A PARTIC|
|00003e20| 55 4c 41 52 20 50 55 52 | 50 4f 53 45 2e 20 20 53 |ULAR PUR|POSE. S|
|00003e30| 65 65 20 74 68 65 20 47 | 4e 55 0a 4c 69 62 72 61 |ee the G|NU.Libra|
|00003e40| 72 79 20 47 65 6e 65 72 | 61 6c 20 50 75 62 6c 69 |ry Gener|al Publi|
|00003e50| 63 20 4c 69 63 65 6e 73 | 65 20 66 6f 72 20 6d 6f |c Licens|e for mo|
|00003e60| 72 65 20 64 65 74 61 69 | 6c 73 2e 0a 0a 59 6f 75 |re detai|ls...You|
|00003e70| 20 73 68 6f 75 6c 64 20 | 68 61 76 65 20 72 65 63 | should |have rec|
|00003e80| 65 69 76 65 64 20 61 20 | 63 6f 70 79 20 6f 66 20 |eived a |copy of |
|00003e90| 74 68 65 20 47 4e 55 20 | 4c 69 62 72 61 72 79 20 |the GNU |Library |
|00003ea0| 47 65 6e 65 72 61 6c 20 | 50 75 62 6c 69 63 0a 4c |General |Public.L|
|00003eb0| 69 63 65 6e 73 65 20 61 | 6c 6f 6e 67 20 77 69 74 |icense a|long wit|
|00003ec0| 68 20 74 68 69 73 20 6c | 69 62 72 61 72 79 3b 20 |h this l|ibrary; |
|00003ed0| 69 66 20 6e 6f 74 2c 20 | 77 72 69 74 65 20 74 6f |if not, |write to|
|00003ee0| 20 74 68 65 20 46 72 65 | 65 20 53 6f 66 74 77 61 | the Fre|e Softwa|
|00003ef0| 72 65 0a 46 6f 75 6e 64 | 61 74 69 6f 6e 2c 20 49 |re.Found|ation, I|
|00003f00| 6e 63 2e 2c 20 35 39 20 | 54 65 6d 70 6c 65 20 50 |nc., 59 |Temple P|
|00003f10| 6c 61 63 65 20 2d 20 53 | 75 69 74 65 20 33 33 30 |lace - S|uite 330|
|00003f20| 2c 20 42 6f 73 74 6f 6e | 2c 20 4d 41 20 30 32 31 |, Boston|, MA 021|
|00003f30| 31 31 2d 31 33 30 37 2c | 20 55 53 41 2e 0a 2a 2f |11-1307,| USA..*/|
|00003f40| 0a 0a 23 69 6e 63 6c 75 | 64 65 20 3c 70 72 69 76 |..#inclu|de <priv|
|00003f50| 61 74 65 2e 68 3e 0a 0a | 23 69 66 20 48 41 56 45 |ate.h>..|#if HAVE|
|00003f60| 5f 4e 4c 53 0a 23 20 69 | 6e 63 6c 75 64 65 20 3c |_NLS.# i|nclude <|
|00003f70| 6e 6c 5f 74 79 70 65 73 | 2e 68 3e 0a 73 74 61 74 |nl_types|.h>.stat|
|00003f80| 69 63 20 6e 6c 5f 63 61 | 74 64 20 5f 6c 69 62 65 |ic nl_ca|td _libe|
|00003f90| 6c 66 5f 63 61 74 20 3d | 20 28 6e 6c 5f 63 61 74 |lf_cat =| (nl_cat|
|00003fa0| 64 29 30 3b 0a 73 74 61 | 74 69 63 20 63 6f 6e 73 |d)0;.sta|tic cons|
|00003fb0| 74 20 63 68 61 72 20 64 | 6f 6d 61 69 6e 5b 5d 20 |t char d|omain[] |
|00003fc0| 3d 20 22 6c 69 62 65 6c | 66 22 3b 0a 23 65 6e 64 |= "libel|f";.#end|
|00003fd0| 69 66 0a 0a 73 74 61 74 | 69 63 20 63 6f 6e 73 74 |if..stat|ic const|
|00003fe0| 20 63 68 61 72 20 2a 5f | 6d 65 73 73 61 67 65 73 | char *_|messages|
|00003ff0| 5b 5d 20 3d 20 7b 0a 23 | 64 65 66 69 6e 65 20 5f |[] = {.#|define _|
|00004000| 5f 65 72 72 5f 5f 28 61 | 2c 62 29 09 62 2c 0a 23 |_err__(a|,b).b,.#|
|00004010| 69 6e 63 6c 75 64 65 20 | 3c 65 72 72 6f 72 73 2e |include |<errors.|
|00004020| 68 3e 09 09 2f 2a 20 69 | 6e 63 6c 75 64 65 20 73 |h>../* i|nclude s|
|00004030| 74 72 69 6e 67 20 74 61 | 62 6c 65 73 20 66 72 6f |tring ta|bles fro|
|00004040| 6d 20 65 72 72 6f 72 73 | 2e 68 20 2a 2f 0a 23 75 |m errors|.h */.#u|
|00004050| 6e 64 65 66 20 5f 5f 65 | 72 72 5f 5f 0a 7d 3b 0a |ndef __e|rr__.};.|
|00004060| 0a 63 6f 6e 73 74 20 63 | 68 61 72 2a 0a 65 6c 66 |.const c|har*.elf|
|00004070| 5f 65 72 72 6d 73 67 28 | 69 6e 74 20 65 72 72 29 |_errmsg(|int err)|
|00004080| 20 7b 0a 20 20 20 20 69 | 66 20 28 65 72 72 20 3d | {. i|f (err =|
|00004090| 3d 20 30 29 20 7b 0a 09 | 65 72 72 20 3d 20 5f 65 |= 0) {..|err = _e|
|000040a0| 6c 66 5f 65 72 72 6e 6f | 3b 0a 09 69 66 20 28 65 |lf_errno|;..if (e|
|000040b0| 72 72 20 3d 3d 20 30 29 | 20 7b 0a 09 20 20 20 20 |rr == 0)| {.. |
|000040c0| 72 65 74 75 72 6e 20 4e | 55 4c 4c 3b 0a 09 7d 0a |return N|ULL;..}.|
|000040d0| 20 20 20 20 7d 0a 20 20 | 20 20 65 6c 73 65 20 69 | }. | else i|
|000040e0| 66 20 28 65 72 72 20 3d | 3d 20 2d 31 29 20 7b 0a |f (err =|= -1) {.|
|000040f0| 09 65 72 72 20 3d 20 5f | 65 6c 66 5f 65 72 72 6e |.err = _|elf_errn|
|00004100| 6f 3b 0a 20 20 20 20 7d | 0a 0a 20 20 20 20 69 66 |o;. }|.. if|
|00004110| 20 28 65 72 72 20 3c 20 | 30 20 7c 7c 20 65 72 72 | (err < |0 || err|
|00004120| 20 3e 3d 20 45 52 52 4f | 52 5f 4e 55 4d 29 20 7b | >= ERRO|R_NUM) {|
|00004130| 0a 09 65 72 72 20 3d 20 | 45 52 52 4f 52 5f 55 4e |..err = |ERROR_UN|
|00004140| 4b 4e 4f 57 4e 3b 0a 20 | 20 20 20 7d 0a 0a 23 69 |KNOWN;. | }..#i|
|00004150| 66 20 48 41 56 45 5f 4e | 4c 53 0a 20 20 20 20 69 |f HAVE_N|LS. i|
|00004160| 66 20 28 5f 6c 69 62 65 | 6c 66 5f 63 61 74 20 3d |f (_libe|lf_cat =|
|00004170| 3d 20 28 6e 6c 5f 63 61 | 74 64 29 30 29 20 7b 0a |= (nl_ca|td)0) {.|
|00004180| 09 5f 6c 69 62 65 6c 66 | 5f 63 61 74 20 3d 20 63 |._libelf|_cat = c|
|00004190| 61 74 6f 70 65 6e 28 64 | 6f 6d 61 69 6e 2c 20 30 |atopen(d|omain, 0|
|000041a0| 29 3b 0a 20 20 20 20 7d | 0a 20 20 20 20 69 66 20 |);. }|. if |
|000041b0| 28 5f 6c 69 62 65 6c 66 | 5f 63 61 74 20 21 3d 20 |(_libelf|_cat != |
|000041c0| 28 6e 6c 5f 63 61 74 64 | 29 2d 31 29 20 7b 0a 09 |(nl_catd|)-1) {..|
|000041d0| 72 65 74 75 72 6e 20 63 | 61 74 67 65 74 73 28 5f |return c|atgets(_|
|000041e0| 6c 69 62 65 6c 66 5f 63 | 61 74 2c 20 31 2c 20 65 |libelf_c|at, 1, e|
|000041f0| 72 72 20 2b 20 31 2c 20 | 5f 6d 65 73 73 61 67 65 |rr + 1, |_message|
|00004200| 73 5b 65 72 72 5d 29 3b | 0a 20 20 20 20 7d 0a 23 |s[err]);|. }.#|
|00004210| 65 6e 64 69 66 0a 20 20 | 20 20 72 65 74 75 72 6e |endif. | return|
|00004220| 20 5f 6d 65 73 73 61 67 | 65 73 5b 65 72 72 5d 3b | _messag|es[err];|
|00004230| 0a 7d 0a 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.}......|........|
|00004240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004280| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004290| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000042a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000042b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000042c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000042d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000042e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000042f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004400| 6c 69 62 65 6c 66 2d 30 | 2e 35 2e 32 2f 65 72 72 |libelf-0|.5.2/err|
|00004410| 6e 6f 2e 63 00 00 00 00 | 00 00 00 00 00 00 00 00 |no.c....|........|
|00004420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004460| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 20 31 |....1006|44 . 1|
|00004470| 34 34 20 00 20 20 20 20 | 32 34 20 00 20 20 20 20 |44 . |24 . |
|00004480| 20 20 20 31 36 35 35 20 | 20 36 30 34 31 35 31 33 | 1655 | 6041513|
|00004490| 37 36 30 20 20 31 33 31 | 37 32 00 20 30 00 00 00 |760 131|72. 0...|
|000044a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000044b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000044c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000044d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000044e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000044f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004500| 00 75 73 74 61 72 20 20 | 00 6d 69 63 68 61 65 6c |.ustar |.michael|
|00004510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004520| 00 00 00 00 00 00 00 00 | 00 73 74 61 66 66 00 00 |........|.staff..|
|00004530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004580| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004600| 2f 2a 0a 65 72 72 6e 6f | 2e 63 20 2d 20 69 6d 70 |/*.errno|.c - imp|
|00004610| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 20 6f 66 20 74 |lementat|ion of t|
|00004620| 68 65 20 65 6c 66 5f 65 | 72 72 6e 6f 28 33 29 20 |he elf_e|rrno(3) |
|00004630| 66 75 6e 63 74 69 6f 6e | 2e 0a 43 6f 70 79 72 69 |function|..Copyri|
|00004640| 67 68 74 20 28 43 29 20 | 31 39 39 35 20 4d 69 63 |ght (C) |1995 Mic|
|00004650| 68 61 65 6c 20 52 69 65 | 70 65 20 3c 72 69 65 70 |hael Rie|pe <riep|
|00004660| 65 40 69 66 77 73 6e 34 | 2e 69 66 77 2e 75 6e 69 |e@ifwsn4|.ifw.uni|
|00004670| 2d 68 61 6e 6e 6f 76 65 | 72 2e 64 65 3e 0a 0a 54 |-hannove|r.de>..T|
|00004680| 68 69 73 20 6c 69 62 72 | 61 72 79 20 69 73 20 66 |his libr|ary is f|
|00004690| 72 65 65 20 73 6f 66 74 | 77 61 72 65 3b 20 79 6f |ree soft|ware; yo|
|000046a0| 75 20 63 61 6e 20 72 65 | 64 69 73 74 72 69 62 75 |u can re|distribu|
|000046b0| 74 65 20 69 74 20 61 6e | 64 2f 6f 72 0a 6d 6f 64 |te it an|d/or.mod|
|000046c0| 69 66 79 20 69 74 20 75 | 6e 64 65 72 20 74 68 65 |ify it u|nder the|
|000046d0| 20 74 65 72 6d 73 20 6f | 66 20 74 68 65 20 47 4e | terms o|f the GN|
|000046e0| 55 20 4c 69 62 72 61 72 | 79 20 47 65 6e 65 72 61 |U Librar|y Genera|
|000046f0| 6c 20 50 75 62 6c 69 63 | 0a 4c 69 63 65 6e 73 65 |l Public|.License|
|00004700| 20 61 73 20 70 75 62 6c | 69 73 68 65 64 20 62 79 | as publ|ished by|
|00004710| 20 74 68 65 20 46 72 65 | 65 20 53 6f 66 74 77 61 | the Fre|e Softwa|
|00004720| 72 65 20 46 6f 75 6e 64 | 61 74 69 6f 6e 3b 20 65 |re Found|ation; e|
|00004730| 69 74 68 65 72 0a 76 65 | 72 73 69 6f 6e 20 32 20 |ither.ve|rsion 2 |
|00004740| 6f 66 20 74 68 65 20 4c | 69 63 65 6e 73 65 2c 20 |of the L|icense, |
|00004750| 6f 72 20 28 61 74 20 79 | 6f 75 72 20 6f 70 74 69 |or (at y|our opti|
|00004760| 6f 6e 29 20 61 6e 79 20 | 6c 61 74 65 72 20 76 65 |on) any |later ve|
|00004770| 72 73 69 6f 6e 2e 0a 0a | 54 68 69 73 20 6c 69 62 |rsion...|This lib|
|00004780| 72 61 72 79 20 69 73 20 | 64 69 73 74 72 69 62 75 |rary is |distribu|
|00004790| 74 65 64 20 69 6e 20 74 | 68 65 20 68 6f 70 65 20 |ted in t|he hope |
|000047a0| 74 68 61 74 20 69 74 20 | 77 69 6c 6c 20 62 65 20 |that it |will be |
|000047b0| 75 73 65 66 75 6c 2c 0a | 62 75 74 20 57 49 54 48 |useful,.|but WITH|
|000047c0| 4f 55 54 20 41 4e 59 20 | 57 41 52 52 41 4e 54 59 |OUT ANY |WARRANTY|
|000047d0| 3b 20 77 69 74 68 6f 75 | 74 20 65 76 65 6e 20 74 |; withou|t even t|
|000047e0| 68 65 20 69 6d 70 6c 69 | 65 64 20 77 61 72 72 61 |he impli|ed warra|
|000047f0| 6e 74 79 20 6f 66 0a 4d | 45 52 43 48 41 4e 54 41 |nty of.M|ERCHANTA|
|00004800| 42 49 4c 49 54 59 20 6f | 72 20 46 49 54 4e 45 53 |BILITY o|r FITNES|
|00004810| 53 20 46 4f 52 20 41 20 | 50 41 52 54 49 43 55 4c |S FOR A |PARTICUL|
|00004820| 41 52 20 50 55 52 50 4f | 53 45 2e 20 20 53 65 65 |AR PURPO|SE. See|
|00004830| 20 74 68 65 20 47 4e 55 | 0a 4c 69 62 72 61 72 79 | the GNU|.Library|
|00004840| 20 47 65 6e 65 72 61 6c | 20 50 75 62 6c 69 63 20 | General| Public |
|00004850| 4c 69 63 65 6e 73 65 20 | 66 6f 72 20 6d 6f 72 65 |License |for more|
|00004860| 20 64 65 74 61 69 6c 73 | 2e 0a 0a 59 6f 75 20 73 | details|...You s|
|00004870| 68 6f 75 6c 64 20 68 61 | 76 65 20 72 65 63 65 69 |hould ha|ve recei|
|00004880| 76 65 64 20 61 20 63 6f | 70 79 20 6f 66 20 74 68 |ved a co|py of th|
|00004890| 65 20 47 4e 55 20 4c 69 | 62 72 61 72 79 20 47 65 |e GNU Li|brary Ge|
|000048a0| 6e 65 72 61 6c 20 50 75 | 62 6c 69 63 0a 4c 69 63 |neral Pu|blic.Lic|
|000048b0| 65 6e 73 65 20 61 6c 6f | 6e 67 20 77 69 74 68 20 |ense alo|ng with |
|000048c0| 74 68 69 73 20 6c 69 62 | 72 61 72 79 3b 20 69 66 |this lib|rary; if|
|000048d0| 20 6e 6f 74 2c 20 77 72 | 69 74 65 20 74 6f 20 74 | not, wr|ite to t|
|000048e0| 68 65 20 46 72 65 65 20 | 53 6f 66 74 77 61 72 65 |he Free |Software|
|000048f0| 0a 46 6f 75 6e 64 61 74 | 69 6f 6e 2c 20 49 6e 63 |.Foundat|ion, Inc|
|00004900| 2e 2c 20 35 39 20 54 65 | 6d 70 6c 65 20 50 6c 61 |., 59 Te|mple Pla|
|00004910| 63 65 20 2d 20 53 75 69 | 74 65 20 33 33 30 2c 20 |ce - Sui|te 330, |
|00004920| 42 6f 73 74 6f 6e 2c 20 | 4d 41 20 30 32 31 31 31 |Boston, |MA 02111|
|00004930| 2d 31 33 30 37 2c 20 55 | 53 41 2e 0a 2a 2f 0a 0a |-1307, U|SA..*/..|
|00004940| 23 69 6e 63 6c 75 64 65 | 20 3c 70 72 69 76 61 74 |#include| <privat|
|00004950| 65 2e 68 3e 0a 0a 69 6e | 74 0a 65 6c 66 5f 65 72 |e.h>..in|t.elf_er|
|00004960| 72 6e 6f 28 76 6f 69 64 | 29 20 7b 0a 20 20 20 20 |rno(void|) {. |
|00004970| 69 6e 74 20 74 6d 70 20 | 3d 20 5f 65 6c 66 5f 65 |int tmp |= _elf_e|
|00004980| 72 72 6e 6f 3b 0a 0a 20 | 20 20 20 5f 65 6c 66 5f |rrno;.. | _elf_|
|00004990| 65 72 72 6e 6f 20 3d 20 | 30 3b 0a 20 20 20 20 72 |errno = |0;. r|
|000049a0| 65 74 75 72 6e 20 74 6d | 70 3b 0a 7d 0a 00 00 00 |eturn tm|p;.}....|
|000049b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a00| 6c 69 62 65 6c 66 2d 30 | 2e 35 2e 32 2f 66 69 6c |libelf-0|.5.2/fil|
|00004a10| 6c 2e 63 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |l.c.....|........|
|00004a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a60| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 20 31 |....1006|44 . 1|
|00004a70| 34 34 20 00 20 20 20 20 | 32 34 20 00 20 20 20 20 |44 . |24 . |
|00004a80| 20 20 20 31 36 30 36 20 | 20 36 30 34 31 35 31 33 | 1606 | 6041513|
|00004a90| 37 36 31 20 20 31 32 37 | 37 30 00 20 30 00 00 00 |761 127|70. 0...|
|00004aa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b00| 00 75 73 74 61 72 20 20 | 00 6d 69 63 68 61 65 6c |.ustar |.michael|
|00004b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b20| 00 00 00 00 00 00 00 00 | 00 73 74 61 66 66 00 00 |........|.staff..|
|00004b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c00| 2f 2a 0a 66 69 6c 6c 2e | 63 20 2d 20 69 6d 70 6c |/*.fill.|c - impl|
|00004c10| 65 6d 65 6e 74 61 74 69 | 6f 6e 20 6f 66 20 74 68 |ementati|on of th|
|00004c20| 65 20 65 6c 66 5f 66 69 | 6c 6c 28 33 29 20 66 75 |e elf_fi|ll(3) fu|
|00004c30| 6e 63 74 69 6f 6e 2e 0a | 43 6f 70 79 72 69 67 68 |nction..|Copyrigh|
|00004c40| 74 20 28 43 29 20 31 39 | 39 35 20 4d 69 63 68 61 |t (C) 19|95 Micha|
|00004c50| 65 6c 20 52 69 65 70 65 | 20 3c 72 69 65 70 65 40 |el Riepe| <riepe@|
|00004c60| 69 66 77 73 6e 34 2e 69 | 66 77 2e 75 6e 69 2d 68 |ifwsn4.i|fw.uni-h|
|00004c70| 61 6e 6e 6f 76 65 72 2e | 64 65 3e 0a 0a 54 68 69 |annover.|de>..Thi|
|00004c80| 73 20 6c 69 62 72 61 72 | 79 20 69 73 20 66 72 65 |s librar|y is fre|
|00004c90| 65 20 73 6f 66 74 77 61 | 72 65 3b 20 79 6f 75 20 |e softwa|re; you |
|00004ca0| 63 61 6e 20 72 65 64 69 | 73 74 72 69 62 75 74 65 |can redi|stribute|
|00004cb0| 20 69 74 20 61 6e 64 2f | 6f 72 0a 6d 6f 64 69 66 | it and/|or.modif|
|00004cc0| 79 20 69 74 20 75 6e 64 | 65 72 20 74 68 65 20 74 |y it und|er the t|
|00004cd0| 65 72 6d 73 20 6f 66 20 | 74 68 65 20 47 4e 55 20 |erms of |the GNU |
|00004ce0| 4c 69 62 72 61 72 79 20 | 47 65 6e 65 72 61 6c 20 |Library |General |
|00004cf0| 50 75 62 6c 69 63 0a 4c | 69 63 65 6e 73 65 20 61 |Public.L|icense a|
|00004d00| 73 20 70 75 62 6c 69 73 | 68 65 64 20 62 79 20 74 |s publis|hed by t|
|00004d10| 68 65 20 46 72 65 65 20 | 53 6f 66 74 77 61 72 65 |he Free |Software|
|00004d20| 20 46 6f 75 6e 64 61 74 | 69 6f 6e 3b 20 65 69 74 | Foundat|ion; eit|
|00004d30| 68 65 72 0a 76 65 72 73 | 69 6f 6e 20 32 20 6f 66 |her.vers|ion 2 of|
|00004d40| 20 74 68 65 20 4c 69 63 | 65 6e 73 65 2c 20 6f 72 | the Lic|ense, or|
|00004d50| 20 28 61 74 20 79 6f 75 | 72 20 6f 70 74 69 6f 6e | (at you|r option|
|00004d60| 29 20 61 6e 79 20 6c 61 | 74 65 72 20 76 65 72 73 |) any la|ter vers|
|00004d70| 69 6f 6e 2e 0a 0a 54 68 | 69 73 20 6c 69 62 72 61 |ion...Th|is libra|
|00004d80| 72 79 20 69 73 20 64 69 | 73 74 72 69 62 75 74 65 |ry is di|stribute|
|00004d90| 64 20 69 6e 20 74 68 65 | 20 68 6f 70 65 20 74 68 |d in the| hope th|
|00004da0| 61 74 20 69 74 20 77 69 | 6c 6c 20 62 65 20 75 73 |at it wi|ll be us|
|00004db0| 65 66 75 6c 2c 0a 62 75 | 74 20 57 49 54 48 4f 55 |eful,.bu|t WITHOU|
|00004dc0| 54 20 41 4e 59 20 57 41 | 52 52 41 4e 54 59 3b 20 |T ANY WA|RRANTY; |
|00004dd0| 77 69 74 68 6f 75 74 20 | 65 76 65 6e 20 74 68 65 |without |even the|
|00004de0| 20 69 6d 70 6c 69 65 64 | 20 77 61 72 72 61 6e 74 | implied| warrant|
|00004df0| 79 20 6f 66 0a 4d 45 52 | 43 48 41 4e 54 41 42 49 |y of.MER|CHANTABI|
|00004e00| 4c 49 54 59 20 6f 72 20 | 46 49 54 4e 45 53 53 20 |LITY or |FITNESS |
|00004e10| 46 4f 52 20 41 20 50 41 | 52 54 49 43 55 4c 41 52 |FOR A PA|RTICULAR|
|00004e20| 20 50 55 52 50 4f 53 45 | 2e 20 20 53 65 65 20 74 | PURPOSE|. See t|
|00004e30| 68 65 20 47 4e 55 0a 4c | 69 62 72 61 72 79 20 47 |he GNU.L|ibrary G|
|00004e40| 65 6e 65 72 61 6c 20 50 | 75 62 6c 69 63 20 4c 69 |eneral P|ublic Li|
|00004e50| 63 65 6e 73 65 20 66 6f | 72 20 6d 6f 72 65 20 64 |cense fo|r more d|
|00004e60| 65 74 61 69 6c 73 2e 0a | 0a 59 6f 75 20 73 68 6f |etails..|.You sho|
|00004e70| 75 6c 64 20 68 61 76 65 | 20 72 65 63 65 69 76 65 |uld have| receive|
|00004e80| 64 20 61 20 63 6f 70 79 | 20 6f 66 20 74 68 65 20 |d a copy| of the |
|00004e90| 47 4e 55 20 4c 69 62 72 | 61 72 79 20 47 65 6e 65 |GNU Libr|ary Gene|
|00004ea0| 72 61 6c 20 50 75 62 6c | 69 63 0a 4c 69 63 65 6e |ral Publ|ic.Licen|
|00004eb0| 73 65 20 61 6c 6f 6e 67 | 20 77 69 74 68 20 74 68 |se along| with th|
|00004ec0| 69 73 20 6c 69 62 72 61 | 72 79 3b 20 69 66 20 6e |is libra|ry; if n|
|00004ed0| 6f 74 2c 20 77 72 69 74 | 65 20 74 6f 20 74 68 65 |ot, writ|e to the|
|00004ee0| 20 46 72 65 65 20 53 6f | 66 74 77 61 72 65 0a 46 | Free So|ftware.F|
|00004ef0| 6f 75 6e 64 61 74 69 6f | 6e 2c 20 49 6e 63 2e 2c |oundatio|n, Inc.,|
|00004f00| 20 35 39 20 54 65 6d 70 | 6c 65 20 50 6c 61 63 65 | 59 Temp|le Place|
|00004f10| 20 2d 20 53 75 69 74 65 | 20 33 33 30 2c 20 42 6f | - Suite| 330, Bo|
|00004f20| 73 74 6f 6e 2c 20 4d 41 | 20 30 32 31 31 31 2d 31 |ston, MA| 02111-1|
|00004f30| 33 30 37 2c 20 55 53 41 | 2e 0a 2a 2f 0a 0a 23 69 |307, USA|..*/..#i|
|00004f40| 6e 63 6c 75 64 65 20 3c | 70 72 69 76 61 74 65 2e |nclude <|private.|
|00004f50| 68 3e 0a 0a 76 6f 69 64 | 0a 65 6c 66 5f 66 69 6c |h>..void|.elf_fil|
|00004f60| 6c 28 69 6e 74 20 66 69 | 6c 6c 29 20 7b 0a 20 20 |l(int fi|ll) {. |
|00004f70| 20 20 5f 65 6c 66 5f 66 | 69 6c 6c 20 3d 20 66 69 | _elf_f|ill = fi|
|00004f80| 6c 6c 3b 0a 7d 0a 00 00 | 00 00 00 00 00 00 00 00 |ll;.}...|........|
|00004f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005000| 6c 69 62 65 6c 66 2d 30 | 2e 35 2e 32 2f 66 6c 61 |libelf-0|.5.2/fla|
|00005010| 67 2e 63 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |g.c.....|........|
|00005020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005060| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 20 31 |....1006|44 . 1|
|00005070| 34 34 20 00 20 20 20 20 | 32 34 20 00 20 20 20 20 |44 . |24 . |
|00005080| 20 20 20 34 34 30 31 20 | 20 36 30 34 31 35 31 33 | 4401 | 6041513|
|00005090| 37 36 31 20 20 31 32 37 | 34 37 00 20 30 00 00 00 |761 127|47. 0...|
|000050a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005100| 00 75 73 74 61 72 20 20 | 00 6d 69 63 68 61 65 6c |.ustar |.michael|
|00005110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005120| 00 00 00 00 00 00 00 00 | 00 73 74 61 66 66 00 00 |........|.staff..|
|00005130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005200| 2f 2a 0a 66 6c 61 67 2e | 63 20 2d 20 69 6d 70 6c |/*.flag.|c - impl|
|00005210| 65 6d 65 6e 74 61 74 69 | 6f 6e 20 6f 66 20 74 68 |ementati|on of th|
|00005220| 65 20 65 6c 66 5f 66 6c | 61 67 2a 28 33 29 20 66 |e elf_fl|ag*(3) f|
|00005230| 75 6e 63 74 69 6f 6e 73 | 2e 0a 43 6f 70 79 72 69 |unctions|..Copyri|
|00005240| 67 68 74 20 28 43 29 20 | 31 39 39 35 20 4d 69 63 |ght (C) |1995 Mic|
|00005250| 68 61 65 6c 20 52 69 65 | 70 65 20 3c 72 69 65 70 |hael Rie|pe <riep|
|00005260| 65 40 69 66 77 73 6e 34 | 2e 69 66 77 2e 75 6e 69 |e@ifwsn4|.ifw.uni|
|00005270| 2d 68 61 6e 6e 6f 76 65 | 72 2e 64 65 3e 0a 0a 54 |-hannove|r.de>..T|
|00005280| 68 69 73 20 6c 69 62 72 | 61 72 79 20 69 73 20 66 |his libr|ary is f|
|00005290| 72 65 65 20 73 6f 66 74 | 77 61 72 65 3b 20 79 6f |ree soft|ware; yo|
|000052a0| 75 20 63 61 6e 20 72 65 | 64 69 73 74 72 69 62 75 |u can re|distribu|
|000052b0| 74 65 20 69 74 20 61 6e | 64 2f 6f 72 0a 6d 6f 64 |te it an|d/or.mod|
|000052c0| 69 66 79 20 69 74 20 75 | 6e 64 65 72 20 74 68 65 |ify it u|nder the|
|000052d0| 20 74 65 72 6d 73 20 6f | 66 20 74 68 65 20 47 4e | terms o|f the GN|
|000052e0| 55 20 4c 69 62 72 61 72 | 79 20 47 65 6e 65 72 61 |U Librar|y Genera|
|000052f0| 6c 20 50 75 62 6c 69 63 | 0a 4c 69 63 65 6e 73 65 |l Public|.License|
|00005300| 20 61 73 20 70 75 62 6c | 69 73 68 65 64 20 62 79 | as publ|ished by|
|00005310| 20 74 68 65 20 46 72 65 | 65 20 53 6f 66 74 77 61 | the Fre|e Softwa|
|00005320| 72 65 20 46 6f 75 6e 64 | 61 74 69 6f 6e 3b 20 65 |re Found|ation; e|
|00005330| 69 74 68 65 72 0a 76 65 | 72 73 69 6f 6e 20 32 20 |ither.ve|rsion 2 |
|00005340| 6f 66 20 74 68 65 20 4c | 69 63 65 6e 73 65 2c 20 |of the L|icense, |
|00005350| 6f 72 20 28 61 74 20 79 | 6f 75 72 20 6f 70 74 69 |or (at y|our opti|
|00005360| 6f 6e 29 20 61 6e 79 20 | 6c 61 74 65 72 20 76 65 |on) any |later ve|
|00005370| 72 73 69 6f 6e 2e 0a 0a | 54 68 69 73 20 6c 69 62 |rsion...|This lib|
|00005380| 72 61 72 79 20 69 73 20 | 64 69 73 74 72 69 62 75 |rary is |distribu|
|00005390| 74 65 64 20 69 6e 20 74 | 68 65 20 68 6f 70 65 20 |ted in t|he hope |
|000053a0| 74 68 61 74 20 69 74 20 | 77 69 6c 6c 20 62 65 20 |that it |will be |
|000053b0| 75 73 65 66 75 6c 2c 0a | 62 75 74 20 57 49 54 48 |useful,.|but WITH|
|000053c0| 4f 55 54 20 41 4e 59 20 | 57 41 52 52 41 4e 54 59 |OUT ANY |WARRANTY|
|000053d0| 3b 20 77 69 74 68 6f 75 | 74 20 65 76 65 6e 20 74 |; withou|t even t|
|000053e0| 68 65 20 69 6d 70 6c 69 | 65 64 20 77 61 72 72 61 |he impli|ed warra|
|000053f0| 6e 74 79 20 6f 66 0a 4d | 45 52 43 48 41 4e 54 41 |nty of.M|ERCHANTA|
|00005400| 42 49 4c 49 54 59 20 6f | 72 20 46 49 54 4e 45 53 |BILITY o|r FITNES|
|00005410| 53 20 46 4f 52 20 41 20 | 50 41 52 54 49 43 55 4c |S FOR A |PARTICUL|
|00005420| 41 52 20 50 55 52 50 4f | 53 45 2e 20 20 53 65 65 |AR PURPO|SE. See|
|00005430| 20 74 68 65 20 47 4e 55 | 0a 4c 69 62 72 61 72 79 | the GNU|.Library|
|00005440| 20 47 65 6e 65 72 61 6c | 20 50 75 62 6c 69 63 20 | General| Public |
|00005450| 4c 69 63 65 6e 73 65 20 | 66 6f 72 20 6d 6f 72 65 |License |for more|
|00005460| 20 64 65 74 61 69 6c 73 | 2e 0a 0a 59 6f 75 20 73 | details|...You s|
|00005470| 68 6f 75 6c 64 20 68 61 | 76 65 20 72 65 63 65 69 |hould ha|ve recei|
|00005480| 76 65 64 20 61 20 63 6f | 70 79 20 6f 66 20 74 68 |ved a co|py of th|
|00005490| 65 20 47 4e 55 20 4c 69 | 62 72 61 72 79 20 47 65 |e GNU Li|brary Ge|
|000054a0| 6e 65 72 61 6c 20 50 75 | 62 6c 69 63 0a 4c 69 63 |neral Pu|blic.Lic|
|000054b0| 65 6e 73 65 20 61 6c 6f | 6e 67 20 77 69 74 68 20 |ense alo|ng with |
|000054c0| 74 68 69 73 20 6c 69 62 | 72 61 72 79 3b 20 69 66 |this lib|rary; if|
|000054d0| 20 6e 6f 74 2c 20 77 72 | 69 74 65 20 74 6f 20 74 | not, wr|ite to t|
|000054e0| 68 65 20 46 72 65 65 20 | 53 6f 66 74 77 61 72 65 |he Free |Software|
|000054f0| 0a 46 6f 75 6e 64 61 74 | 69 6f 6e 2c 20 49 6e 63 |.Foundat|ion, Inc|
|00005500| 2e 2c 20 35 39 20 54 65 | 6d 70 6c 65 20 50 6c 61 |., 59 Te|mple Pla|
|00005510| 63 65 20 2d 20 53 75 69 | 74 65 20 33 33 30 2c 20 |ce - Sui|te 330, |
|00005520| 42 6f 73 74 6f 6e 2c 20 | 4d 41 20 30 32 31 31 31 |Boston, |MA 02111|
|00005530| 2d 31 33 30 37 2c 20 55 | 53 41 2e 0a 2a 2f 0a 0a |-1307, U|SA..*/..|
|00005540| 23 69 6e 63 6c 75 64 65 | 20 3c 70 72 69 76 61 74 |#include| <privat|
|00005550| 65 2e 68 3e 0a 0a 73 74 | 61 74 69 63 20 75 6e 73 |e.h>..st|atic uns|
|00005560| 69 67 6e 65 64 0a 5f 65 | 6c 66 5f 66 6c 61 67 28 |igned._e|lf_flag(|
|00005570| 75 6e 73 69 67 6e 65 64 | 20 2a 66 2c 20 45 6c 66 |unsigned| *f, Elf|
|00005580| 5f 43 6d 64 20 63 6d 64 | 2c 20 75 6e 73 69 67 6e |_Cmd cmd|, unsign|
|00005590| 65 64 20 66 6c 61 67 73 | 29 20 7b 0a 20 20 20 20 |ed flags|) {. |
|000055a0| 69 66 20 28 63 6d 64 20 | 3d 3d 20 45 4c 46 5f 43 |if (cmd |== ELF_C|
|000055b0| 5f 53 45 54 29 20 7b 0a | 09 72 65 74 75 72 6e 20 |_SET) {.|.return |
|000055c0| 2a 66 20 7c 3d 20 66 6c | 61 67 73 3b 0a 20 20 20 |*f |= fl|ags;. |
|000055d0| 20 7d 0a 20 20 20 20 69 | 66 20 28 63 6d 64 20 3d | }. i|f (cmd =|
|000055e0| 3d 20 45 4c 46 5f 43 5f | 43 4c 52 29 20 7b 0a 09 |= ELF_C_|CLR) {..|
|000055f0| 72 65 74 75 72 6e 20 2a | 66 20 26 3d 20 7e 66 6c |return *|f &= ~fl|
|00005600| 61 67 73 3b 0a 20 20 20 | 20 7d 0a 20 20 20 20 73 |ags;. | }. s|
|00005610| 65 74 65 72 72 28 45 52 | 52 4f 52 5f 49 4e 56 41 |eterr(ER|ROR_INVA|
|00005620| 4c 49 44 5f 43 4d 44 29 | 3b 0a 20 20 20 20 72 65 |LID_CMD)|;. re|
|00005630| 74 75 72 6e 20 30 3b 0a | 7d 0a 0a 75 6e 73 69 67 |turn 0;.|}..unsig|
|00005640| 6e 65 64 0a 65 6c 66 5f | 66 6c 61 67 64 61 74 61 |ned.elf_|flagdata|
|00005650| 28 45 6c 66 5f 44 61 74 | 61 20 2a 64 61 74 61 2c |(Elf_Dat|a *data,|
|00005660| 20 45 6c 66 5f 43 6d 64 | 20 63 6d 64 2c 20 75 6e | Elf_Cmd| cmd, un|
|00005670| 73 69 67 6e 65 64 20 66 | 6c 61 67 73 29 20 7b 0a |signed f|lags) {.|
|00005680| 20 20 20 20 53 63 6e 5f | 44 61 74 61 20 2a 73 64 | Scn_|Data *sd|
|00005690| 20 3d 20 28 53 63 6e 5f | 44 61 74 61 2a 29 64 61 | = (Scn_|Data*)da|
|000056a0| 74 61 3b 0a 0a 20 20 20 | 20 69 66 20 28 21 73 64 |ta;.. | if (!sd|
|000056b0| 29 20 7b 0a 09 72 65 74 | 75 72 6e 20 30 3b 0a 20 |) {..ret|urn 0;. |
|000056c0| 20 20 20 7d 0a 20 20 20 | 20 65 6c 66 5f 61 73 73 | }. | elf_ass|
|000056d0| 65 72 74 28 73 64 2d 3e | 73 64 5f 6d 61 67 69 63 |ert(sd->|sd_magic|
|000056e0| 20 3d 3d 20 44 41 54 41 | 5f 4d 41 47 49 43 29 3b | == DATA|_MAGIC);|
|000056f0| 0a 20 20 20 20 72 65 74 | 75 72 6e 20 5f 65 6c 66 |. ret|urn _elf|
|00005700| 5f 66 6c 61 67 28 26 73 | 64 2d 3e 73 64 5f 64 61 |_flag(&s|d->sd_da|
|00005710| 74 61 5f 66 6c 61 67 73 | 2c 20 63 6d 64 2c 20 66 |ta_flags|, cmd, f|
|00005720| 6c 61 67 73 29 3b 0a 7d | 0a 0a 75 6e 73 69 67 6e |lags);.}|..unsign|
|00005730| 65 64 0a 65 6c 66 5f 66 | 6c 61 67 65 68 64 72 28 |ed.elf_f|lagehdr(|
|00005740| 45 6c 66 20 2a 65 6c 66 | 2c 20 45 6c 66 5f 43 6d |Elf *elf|, Elf_Cm|
|00005750| 64 20 63 6d 64 2c 20 75 | 6e 73 69 67 6e 65 64 20 |d cmd, u|nsigned |
|00005760| 66 6c 61 67 73 29 20 7b | 0a 20 20 20 20 69 66 20 |flags) {|. if |
|00005770| 28 21 65 6c 66 29 20 7b | 0a 09 72 65 74 75 72 6e |(!elf) {|..return|
|00005780| 20 30 3b 0a 20 20 20 20 | 7d 0a 20 20 20 20 65 6c | 0;. |}. el|
|00005790| 66 5f 61 73 73 65 72 74 | 28 65 6c 66 2d 3e 65 5f |f_assert|(elf->e_|
|000057a0| 6d 61 67 69 63 20 3d 3d | 20 45 4c 46 5f 4d 41 47 |magic ==| ELF_MAG|
|000057b0| 49 43 29 3b 0a 20 20 20 | 20 72 65 74 75 72 6e 20 |IC);. | return |
|000057c0| 5f 65 6c 66 5f 66 6c 61 | 67 28 26 65 6c 66 2d 3e |_elf_fla|g(&elf->|
|000057d0| 65 5f 65 68 64 72 5f 66 | 6c 61 67 73 2c 20 63 6d |e_ehdr_f|lags, cm|
|000057e0| 64 2c 20 66 6c 61 67 73 | 29 3b 0a 7d 0a 0a 75 6e |d, flags|);.}..un|
|000057f0| 73 69 67 6e 65 64 0a 65 | 6c 66 5f 66 6c 61 67 65 |signed.e|lf_flage|
|00005800| 6c 66 28 45 6c 66 20 2a | 65 6c 66 2c 20 45 6c 66 |lf(Elf *|elf, Elf|
|00005810| 5f 43 6d 64 20 63 6d 64 | 2c 20 75 6e 73 69 67 6e |_Cmd cmd|, unsign|
|00005820| 65 64 20 66 6c 61 67 73 | 29 20 7b 0a 20 20 20 20 |ed flags|) {. |
|00005830| 69 66 20 28 21 65 6c 66 | 29 20 7b 0a 09 72 65 74 |if (!elf|) {..ret|
|00005840| 75 72 6e 20 30 3b 0a 20 | 20 20 20 7d 0a 20 20 20 |urn 0;. | }. |
|00005850| 20 65 6c 66 5f 61 73 73 | 65 72 74 28 65 6c 66 2d | elf_ass|ert(elf-|
|00005860| 3e 65 5f 6d 61 67 69 63 | 20 3d 3d 20 45 4c 46 5f |>e_magic| == ELF_|
|00005870| 4d 41 47 49 43 29 3b 0a | 20 20 20 20 72 65 74 75 |MAGIC);.| retu|
|00005880| 72 6e 20 5f 65 6c 66 5f | 66 6c 61 67 28 26 65 6c |rn _elf_|flag(&el|
|00005890| 66 2d 3e 65 5f 65 6c 66 | 5f 66 6c 61 67 73 2c 20 |f->e_elf|_flags, |
|000058a0| 63 6d 64 2c 20 66 6c 61 | 67 73 29 3b 0a 7d 0a 0a |cmd, fla|gs);.}..|
|000058b0| 75 6e 73 69 67 6e 65 64 | 0a 65 6c 66 5f 66 6c 61 |unsigned|.elf_fla|
|000058c0| 67 70 68 64 72 28 45 6c | 66 20 2a 65 6c 66 2c 20 |gphdr(El|f *elf, |
|000058d0| 45 6c 66 5f 43 6d 64 20 | 63 6d 64 2c 20 75 6e 73 |Elf_Cmd |cmd, uns|
|000058e0| 69 67 6e 65 64 20 66 6c | 61 67 73 29 20 7b 0a 20 |igned fl|ags) {. |
|000058f0| 20 20 20 69 66 20 28 21 | 65 6c 66 29 20 7b 0a 09 | if (!|elf) {..|
|00005900| 72 65 74 75 72 6e 20 30 | 3b 0a 20 20 20 20 7d 0a |return 0|;. }.|
|00005910| 20 20 20 20 65 6c 66 5f | 61 73 73 65 72 74 28 65 | elf_|assert(e|
|00005920| 6c 66 2d 3e 65 5f 6d 61 | 67 69 63 20 3d 3d 20 45 |lf->e_ma|gic == E|
|00005930| 4c 46 5f 4d 41 47 49 43 | 29 3b 0a 20 20 20 20 72 |LF_MAGIC|);. r|
|00005940| 65 74 75 72 6e 20 5f 65 | 6c 66 5f 66 6c 61 67 28 |eturn _e|lf_flag(|
|00005950| 26 65 6c 66 2d 3e 65 5f | 70 68 64 72 5f 66 6c 61 |&elf->e_|phdr_fla|
|00005960| 67 73 2c 20 63 6d 64 2c | 20 66 6c 61 67 73 29 3b |gs, cmd,| flags);|
|00005970| 0a 7d 0a 0a 75 6e 73 69 | 67 6e 65 64 0a 65 6c 66 |.}..unsi|gned.elf|
|00005980| 5f 66 6c 61 67 73 63 6e | 28 45 6c 66 5f 53 63 6e |_flagscn|(Elf_Scn|
|00005990| 20 2a 73 63 6e 2c 20 45 | 6c 66 5f 43 6d 64 20 63 | *scn, E|lf_Cmd c|
|000059a0| 6d 64 2c 20 75 6e 73 69 | 67 6e 65 64 20 66 6c 61 |md, unsi|gned fla|
|000059b0| 67 73 29 20 7b 0a 20 20 | 20 20 69 66 20 28 21 73 |gs) {. | if (!s|
|000059c0| 63 6e 29 20 7b 0a 09 72 | 65 74 75 72 6e 20 30 3b |cn) {..r|eturn 0;|
|000059d0| 0a 20 20 20 20 7d 0a 20 | 20 20 20 65 6c 66 5f 61 |. }. | elf_a|
|000059e0| 73 73 65 72 74 28 73 63 | 6e 2d 3e 73 5f 6d 61 67 |ssert(sc|n->s_mag|
|000059f0| 69 63 20 3d 3d 20 53 43 | 4e 5f 4d 41 47 49 43 29 |ic == SC|N_MAGIC)|
|00005a00| 3b 0a 20 20 20 20 72 65 | 74 75 72 6e 20 5f 65 6c |;. re|turn _el|
|00005a10| 66 5f 66 6c 61 67 28 26 | 73 63 6e 2d 3e 73 5f 73 |f_flag(&|scn->s_s|
|00005a20| 63 6e 5f 66 6c 61 67 73 | 2c 20 63 6d 64 2c 20 66 |cn_flags|, cmd, f|
|00005a30| 6c 61 67 73 29 3b 0a 7d | 0a 0a 75 6e 73 69 67 6e |lags);.}|..unsign|
|00005a40| 65 64 0a 65 6c 66 5f 66 | 6c 61 67 73 68 64 72 28 |ed.elf_f|lagshdr(|
|00005a50| 45 6c 66 5f 53 63 6e 20 | 2a 73 63 6e 2c 20 45 6c |Elf_Scn |*scn, El|
|00005a60| 66 5f 43 6d 64 20 63 6d | 64 2c 20 75 6e 73 69 67 |f_Cmd cm|d, unsig|
|00005a70| 6e 65 64 20 66 6c 61 67 | 73 29 20 7b 0a 20 20 20 |ned flag|s) {. |
|00005a80| 20 69 66 20 28 21 73 63 | 6e 29 20 7b 0a 09 72 65 | if (!sc|n) {..re|
|00005a90| 74 75 72 6e 20 30 3b 0a | 20 20 20 20 7d 0a 20 20 |turn 0;.| }. |
|00005aa0| 20 20 65 6c 66 5f 61 73 | 73 65 72 74 28 73 63 6e | elf_as|sert(scn|
|00005ab0| 2d 3e 73 5f 6d 61 67 69 | 63 20 3d 3d 20 53 43 4e |->s_magi|c == SCN|
|00005ac0| 5f 4d 41 47 49 43 29 3b | 0a 20 20 20 20 72 65 74 |_MAGIC);|. ret|
|00005ad0| 75 72 6e 20 5f 65 6c 66 | 5f 66 6c 61 67 28 26 73 |urn _elf|_flag(&s|
|00005ae0| 63 6e 2d 3e 73 5f 73 68 | 64 72 5f 66 6c 61 67 73 |cn->s_sh|dr_flags|
|00005af0| 2c 20 63 6d 64 2c 20 66 | 6c 61 67 73 29 3b 0a 7d |, cmd, f|lags);.}|
|00005b00| 0a 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c00| 6c 69 62 65 6c 66 2d 30 | 2e 35 2e 32 2f 67 65 74 |libelf-0|.5.2/get|
|00005c10| 61 72 68 64 72 2e 63 00 | 00 00 00 00 00 00 00 00 |arhdr.c.|........|
|00005c20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c60| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 20 31 |....1006|44 . 1|
|00005c70| 34 34 20 00 20 20 20 20 | 32 34 20 00 20 20 20 20 |44 . |24 . |
|00005c80| 20 20 20 32 30 36 34 20 | 20 36 30 34 31 35 31 33 | 2064 | 6041513|
|00005c90| 37 36 31 20 20 31 33 36 | 34 31 00 20 30 00 00 00 |761 136|41. 0...|
|00005ca0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005cb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d00| 00 75 73 74 61 72 20 20 | 00 6d 69 63 68 61 65 6c |.ustar |.michael|
|00005d10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d20| 00 00 00 00 00 00 00 00 | 00 73 74 61 66 66 00 00 |........|.staff..|
|00005d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e00| 2f 2a 0a 67 65 74 61 72 | 68 64 72 2e 63 20 2d 20 |/*.getar|hdr.c - |
|00005e10| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 20 6f |implemen|tation o|
|00005e20| 66 20 74 68 65 20 65 6c | 66 5f 67 65 74 61 72 68 |f the el|f_getarh|
|00005e30| 64 72 28 33 29 20 66 75 | 6e 63 74 69 6f 6e 2e 0a |dr(3) fu|nction..|
|00005e40| 43 6f 70 79 72 69 67 68 | 74 20 28 43 29 20 31 39 |Copyrigh|t (C) 19|
|00005e50| 39 35 20 4d 69 63 68 61 | 65 6c 20 52 69 65 70 65 |95 Micha|el Riepe|
|00005e60| 20 3c 72 69 65 70 65 40 | 69 66 77 73 6e 34 2e 69 | <riepe@|ifwsn4.i|
|00005e70| 66 77 2e 75 6e 69 2d 68 | 61 6e 6e 6f 76 65 72 2e |fw.uni-h|annover.|
|00005e80| 64 65 3e 0a 0a 54 68 69 | 73 20 6c 69 62 72 61 72 |de>..Thi|s librar|
|00005e90| 79 20 69 73 20 66 72 65 | 65 20 73 6f 66 74 77 61 |y is fre|e softwa|
|00005ea0| 72 65 3b 20 79 6f 75 20 | 63 61 6e 20 72 65 64 69 |re; you |can redi|
|00005eb0| 73 74 72 69 62 75 74 65 | 20 69 74 20 61 6e 64 2f |stribute| it and/|
|00005ec0| 6f 72 0a 6d 6f 64 69 66 | 79 20 69 74 20 75 6e 64 |or.modif|y it und|
|00005ed0| 65 72 20 74 68 65 20 74 | 65 72 6d 73 20 6f 66 20 |er the t|erms of |
|00005ee0| 74 68 65 20 47 4e 55 20 | 4c 69 62 72 61 72 79 20 |the GNU |Library |
|00005ef0| 47 65 6e 65 72 61 6c 20 | 50 75 62 6c 69 63 0a 4c |General |Public.L|
|00005f00| 69 63 65 6e 73 65 20 61 | 73 20 70 75 62 6c 69 73 |icense a|s publis|
|00005f10| 68 65 64 20 62 79 20 74 | 68 65 20 46 72 65 65 20 |hed by t|he Free |
|00005f20| 53 6f 66 74 77 61 72 65 | 20 46 6f 75 6e 64 61 74 |Software| Foundat|
|00005f30| 69 6f 6e 3b 20 65 69 74 | 68 65 72 0a 76 65 72 73 |ion; eit|her.vers|
|00005f40| 69 6f 6e 20 32 20 6f 66 | 20 74 68 65 20 4c 69 63 |ion 2 of| the Lic|
|00005f50| 65 6e 73 65 2c 20 6f 72 | 20 28 61 74 20 79 6f 75 |ense, or| (at you|
|00005f60| 72 20 6f 70 74 69 6f 6e | 29 20 61 6e 79 20 6c 61 |r option|) any la|
|00005f70| 74 65 72 20 76 65 72 73 | 69 6f 6e 2e 0a 0a 54 68 |ter vers|ion...Th|
|00005f80| 69 73 20 6c 69 62 72 61 | 72 79 20 69 73 20 64 69 |is libra|ry is di|
|00005f90| 73 74 72 69 62 75 74 65 | 64 20 69 6e 20 74 68 65 |stribute|d in the|
|00005fa0| 20 68 6f 70 65 20 74 68 | 61 74 20 69 74 20 77 69 | hope th|at it wi|
|00005fb0| 6c 6c 20 62 65 20 75 73 | 65 66 75 6c 2c 0a 62 75 |ll be us|eful,.bu|
|00005fc0| 74 20 57 49 54 48 4f 55 | 54 20 41 4e 59 20 57 41 |t WITHOU|T ANY WA|
|00005fd0| 52 52 41 4e 54 59 3b 20 | 77 69 74 68 6f 75 74 20 |RRANTY; |without |
|00005fe0| 65 76 65 6e 20 74 68 65 | 20 69 6d 70 6c 69 65 64 |even the| implied|
|00005ff0| 20 77 61 72 72 61 6e 74 | 79 20 6f 66 0a 4d 45 52 | warrant|y of.MER|
|00006000| 43 48 41 4e 54 41 42 49 | 4c 49 54 59 20 6f 72 20 |CHANTABI|LITY or |
|00006010| 46 49 54 4e 45 53 53 20 | 46 4f 52 20 41 20 50 41 |FITNESS |FOR A PA|
|00006020| 52 54 49 43 55 4c 41 52 | 20 50 55 52 50 4f 53 45 |RTICULAR| PURPOSE|
|00006030| 2e 20 20 53 65 65 20 74 | 68 65 20 47 4e 55 0a 4c |. See t|he GNU.L|
|00006040| 69 62 72 61 72 79 20 47 | 65 6e 65 72 61 6c 20 50 |ibrary G|eneral P|
|00006050| 75 62 6c 69 63 20 4c 69 | 63 65 6e 73 65 20 66 6f |ublic Li|cense fo|
|00006060| 72 20 6d 6f 72 65 20 64 | 65 74 61 69 6c 73 2e 0a |r more d|etails..|
|00006070| 0a 59 6f 75 20 73 68 6f | 75 6c 64 20 68 61 76 65 |.You sho|uld have|
|00006080| 20 72 65 63 65 69 76 65 | 64 20 61 20 63 6f 70 79 | receive|d a copy|
|00006090| 20 6f 66 20 74 68 65 20 | 47 4e 55 20 4c 69 62 72 | of the |GNU Libr|
|000060a0| 61 72 79 20 47 65 6e 65 | 72 61 6c 20 50 75 62 6c |ary Gene|ral Publ|
|000060b0| 69 63 0a 4c 69 63 65 6e | 73 65 20 61 6c 6f 6e 67 |ic.Licen|se along|
|000060c0| 20 77 69 74 68 20 74 68 | 69 73 20 6c 69 62 72 61 | with th|is libra|
|000060d0| 72 79 3b 20 69 66 20 6e | 6f 74 2c 20 77 72 69 74 |ry; if n|ot, writ|
|000060e0| 65 20 74 6f 20 74 68 65 | 20 46 72 65 65 20 53 6f |e to the| Free So|
|000060f0| 66 74 77 61 72 65 0a 46 | 6f 75 6e 64 61 74 69 6f |ftware.F|oundatio|
|00006100| 6e 2c 20 49 6e 63 2e 2c | 20 35 39 20 54 65 6d 70 |n, Inc.,| 59 Temp|
|00006110| 6c 65 20 50 6c 61 63 65 | 20 2d 20 53 75 69 74 65 |le Place| - Suite|
|00006120| 20 33 33 30 2c 20 42 6f | 73 74 6f 6e 2c 20 4d 41 | 330, Bo|ston, MA|
|00006130| 20 30 32 31 31 31 2d 31 | 33 30 37 2c 20 55 53 41 | 02111-1|307, USA|
|00006140| 2e 0a 2a 2f 0a 0a 23 69 | 6e 63 6c 75 64 65 20 3c |..*/..#i|nclude <|
|00006150| 70 72 69 76 61 74 65 2e | 68 3e 0a 0a 45 6c 66 5f |private.|h>..Elf_|
|00006160| 41 72 68 64 72 2a 0a 65 | 6c 66 5f 67 65 74 61 72 |Arhdr*.e|lf_getar|
|00006170| 68 64 72 28 45 6c 66 20 | 2a 65 6c 66 29 20 7b 0a |hdr(Elf |*elf) {.|
|00006180| 20 20 20 20 69 66 20 28 | 21 65 6c 66 29 20 7b 0a | if (|!elf) {.|
|00006190| 09 72 65 74 75 72 6e 20 | 4e 55 4c 4c 3b 0a 20 20 |.return |NULL;. |
|000061a0| 20 20 7d 0a 20 20 20 20 | 65 6c 66 5f 61 73 73 65 | }. |elf_asse|
|000061b0| 72 74 28 65 6c 66 2d 3e | 65 5f 6d 61 67 69 63 20 |rt(elf->|e_magic |
|000061c0| 3d 3d 20 45 4c 46 5f 4d | 41 47 49 43 29 3b 0a 20 |== ELF_M|AGIC);. |
|000061d0| 20 20 20 69 66 20 28 65 | 6c 66 2d 3e 65 5f 61 72 | if (e|lf->e_ar|
|000061e0| 68 64 72 29 20 7b 0a 09 | 72 65 74 75 72 6e 20 65 |hdr) {..|return e|
|000061f0| 6c 66 2d 3e 65 5f 61 72 | 68 64 72 3b 0a 20 20 20 |lf->e_ar|hdr;. |
|00006200| 20 7d 0a 20 20 20 20 73 | 65 74 65 72 72 28 45 52 | }. s|eterr(ER|
|00006210| 52 4f 52 5f 4e 4f 54 41 | 52 43 48 49 56 45 29 3b |ROR_NOTA|RCHIVE);|
|00006220| 0a 20 20 20 20 72 65 74 | 75 72 6e 20 4e 55 4c 4c |. ret|urn NULL|
|00006230| 3b 0a 7d 0a 00 00 00 00 | 00 00 00 00 00 00 00 00 |;.}.....|........|
|00006240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006280| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006290| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000062a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000062b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000062c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000062d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000062e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000062f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000063a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000063b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000063c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000063d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000063e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000063f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.